@hasura/promptql 2.0.0-alpha.4 → 2.0.0-alpha.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -1
- package/biome.json +1 -1
- package/dist/auth/index.d.mts +36 -0
- package/dist/auth/index.d.ts +36 -0
- package/dist/auth/index.js +1 -0
- package/dist/auth/index.mjs +1 -0
- package/dist/chunk-WIDMKT3J.mjs +1 -0
- package/dist/index.d.mts +4769 -2440
- package/dist/index.d.ts +4769 -2440
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/package.json +12 -8
- package/tsconfig.json +5 -2
package/dist/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var h=Object.defineProperty;var j=Object.getOwnPropertyDescriptor;var q=Object.getOwnPropertyNames;var z=Object.prototype.hasOwnProperty;var G=(e,t)=>{for(var r in t)h(e,r,{get:t[r],enumerable:!0})},D=(e,t,r,_)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of q(t))!z.call(e,a)&&a!==r&&h(e,a,{get:()=>t[a],enumerable:!(_=j(t,a))||_.enumerable});return e};var Q=e=>D(h({},"__esModule",{value:!0}),e);var fe={};G(fe,{PromptQLSdk:()=>v,createApolloClient:()=>k,createPromptQLAuthTokenGenerator:()=>B,diffThreadEvents:()=>K,getAgentGeneratedResponse:()=>Y,getAgentInteractionDecisionAcceptInteractionEvent:()=>X,getAgentInteractionDecisionDeclineInteractionEvent:()=>ee,getAgentMessageProcessingStartedEvent:()=>Z,getAgentOrchestratorContextExplorerCompletedEvent:()=>ie,getAgentOrchestratorContextExplorerStartedEvent:()=>ne,getAgentOrchestratorContextExplorerUpdateEvent:()=>d,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>me,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>be,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>le,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>Ie,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>Me,getAgentOrchestratorSchemaExplorerStartedEvent:()=>ce,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>y,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>de,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>ye,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>ue,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>S,getAgentOrchestratorStepProgrammerEvent:()=>Se,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>he,getAgentOrchestratorStepUiProgrammerEvent:()=>ge,getAgentOrchestratorStepUpdateEvent:()=>g,getAgentOrchestratorUpdateEvent:()=>O,getAgentOrchestratorWikiExplorerCompletedEvent:()=>oe,getAgentOrchestratorWikiExplorerStartedEvent:()=>pe,getAgentOrchestratorWikiExplorerUpdateEvent:()=>M,getAgentOrchestratorWikiInfoGeneratedEvent:()=>se,getAgentPlanGenerationStartedEvent:()=>J,getAgentPlanStepGeneratedEvent:()=>$,getAgentPlanningDecisionCompletedEvent:()=>re,getAgentPlanningDecisionPlanningRequiredEvent:()=>ae,getAgentPlanningDecisionStartedEvent:()=>te,getAgentPlanningDecisionUpdateEvent:()=>I,getAgentStartingOrchestratorEvent:()=>_e,getUserCancelEvent:()=>L,getUserMessageEvent:()=>H,isEnrichTokenMutationResponse:()=>A,isLuxAuthPromptQLTokenFailedResponse:()=>f,isLuxAuthPromptQLTokenSuccessResponse:()=>x});module.exports=Q(fe);function c(e){return e=e?e.trim():"",e?e[e.length-1]==="/"?e.slice(0,e.length-1):e:""}function f(e){return e!=null&&typeof e=="object"&&"status"in e&&e.status==="failure"}function x(e){return e!=null&&typeof e=="object"&&"status"in e&&e.status==="success"&&"token"in e}function A(e){return e!=null&&typeof e=="object"&&("data"in e&&!!e.data&&typeof e.data=="object"&&"enrich_token"in e.data&&!!e.data.enrich_token&&typeof e.data.enrich_token=="object"&&"userDirectoryJWT"in e.data.enrich_token||"errors"in e&&Array.isArray(e.errors))}function B(e){let r=`${c(e.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,_={token:"",expiry:new Date(0)},a=e.fetch||fetch,o=async()=>{let n=await a(r,{method:"POST",headers:{Authorization:`pat ${e.serviceAccountToken}`}});switch(n.status){case 200:{let i=await n.json();if(x(i))return i;throw new Error("malformed token response")}case 401:{let i=await n.json();throw f(i)?new Error(i?.error||n.statusText):new Error(n.statusText)}default:{let i=await n.text();throw new Error(i)}}},s=async n=>{let i=await a(e.promptqlGraphQLUrl,{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:n.token,projectId:e.projectId},operationName:"EnrichToken"})});switch(i.status){case 200:{let p=await i.json();if(!A(p)||!p.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(p)}`);return p.data.enrich_token.userDirectoryJWT}default:{let p=await i.text();throw new Error(p)}}};return async()=>{if(_.expiry.getTime()<=Date.now()-1e3){let n=await o(),i=await s(n);_.token=i;let p=new Date(n.expiry);if(Number.isNaN(p.getTime())){let C=new Date;C.setHours(1),_.expiry=C}else _.expiry=p}return _.token}}var u=require("@apollo/client"),T=require("@apollo/client/link/context"),E=require("@apollo/client/link/subscriptions"),P=require("graphql"),R=require("graphql-ws"),k=e=>{let t=new u.HttpLink({uri:e.url,fetch:e.fetch,headers:e.headers}),r=async s=>{let n=await e.getAuthToken();return{headers:{...s,Authorization:`Bearer ${n}`}}},_=new E.GraphQLWsLink((0,R.createClient)({url:e.url,connectionParams:()=>r(e.headers)})),a=new T.SetContextLink(({headers:s})=>r(s)),o=u.ApolloLink.split(({operationType:s})=>s===P.OperationTypeNode.SUBSCRIPTION,_,a.concat(t));return new u.ApolloClient({link:o,cache:new u.InMemoryCache})};var U={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"}}}],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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},w={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"}}}],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"}}}],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"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},arguments:[{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"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"}}]}}]}}]},F={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"}}]}}]}}]},N={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]};var l=class{_options;constructor(t){this._options=t}info(){return this._options.client.query({query:V,variables:{projectId:this._options.projectId}}).then(t=>{if(!t.data?.get_project_info)throw new Error(t.error?.message||"Project not found");return t.data.get_project_info})}};var b=require("rxjs/operators");var m=class{_options;constructor(t){this._options=t}list(t){return this._options.client.query({query:W,variables:{...t,limit:t.limit&&t.limit>0?t.limit:10},fetchPolicy:"no-cache"}).then(r=>r.data?.threads_v2??[])}get(t){if(!t)throw new Error("threadId is required");return this._options.client.query({query:F,variables:{id:t},fetchPolicy:"no-cache"}).then(r=>r.data?.threads_v2_by_pk)}start(t){if(!t.message.trim())throw new Error("message must not be empty");return this._options.client.mutate({mutation:w,variables:{...t,projectId:this._options.projectId,buildId:t.buildId||this._options.buildId,timezone:t.timezone||this._options.defaultTimezone}}).then(r=>{if(!r.data?.start_thread)throw new Error(r.error?.message||"Failed to start thread");return r.data.start_thread})}sendMessage(t){if(!t.threadId)throw new Error("threadId is required");if(!t.message.trim())throw new Error("message must not be empty");return this._options.client.mutate({mutation:U,variables:{...t,timezone:t.timezone||this._options.defaultTimezone}}).then(r=>{if(!r.data?.send_thread_message)throw new Error(r.error?.message||"Failed to continue thread");return r.data.send_thread_message})}subscribeEvents(t,r){if(!t)throw new Error("threadId is required");if(r!=null)try{Number.parseInt(r)}catch{throw new Error("invalid threadEventId")}let _={thread_id:{_eq:t}};return r&&(_.thread_event_id={_gte:r}),this._options.client.subscribe({query:N,variables:{where:_}}).pipe((0,b.map)(a=>{if(a.error)throw a.error;return a.data?.thread_events??[]}))}streamEvents(t,r){return this.subscribeEvents(t,r).pipe((0,b.takeWhile)(_=>{for(let a=_.length-1;a>0;a--){let o=_[a];if("AgentMessage"in o.event_data&&"InteractionFinished"in o.event_data.AgentMessage.update)return!1}return!0},!0))}};var v=class{constructor(t){let r=c(t.promptqlBaseUrl)||"https://promptql.ddn.hasura.app";if(!t.projectId)throw new Error("projectId must not be empty. You can find it in Project Settings > General Settings tab on https://promptql.console.hasura.io.");if(!t.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");let _=r.endsWith("/v1/graphql")?r:`${r}/playground-v2-hge/v1/graphql`,a=B({promptqlGraphQLUrl:_,authHost:t.authHost,projectId:t.projectId,serviceAccountToken:t.serviceAccountToken,fetch:t.fetch});this._options={projectId:t.projectId,buildId:t.buildId,client:k({getAuthToken:a,url:_,fetch:t.fetch,headers:t.headers}),defaultTimezone:t.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone},this.thread=new m(this._options),this.project=new l(this._options)}_options;thread;project};function K(e,t){if(!t.length)return[];if(!e.length)return t;let r=e[e.length-1];if(!r)return t;let _=BigInt(r.thread_event_id),a=t.length-1;for(;a>=0;a--){let o=t[a];if(BigInt(o?.thread_event_id)<=_)break}return t.slice(a+1)}function H(e){return"UserMessage"in e?e.UserMessage:null}function L(e){return"UserCancel"in e?e.UserCancel:null}function J(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("PlanGenerationStarted"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function $(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("PlanStepGenerated"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.PlanStepGenerated}function Y(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("GeneratedResponse"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse}function Z(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("ProcessingStarted"in e.AgentMessage.update.MessageProcessingUpdate.update)?null:e.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function X(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("InteractionDecision"in e.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function ee(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("InteractionDecision"in e.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function I(e){return!("AgentMessage"in e)||!("PlanningDecisionUpdate"in e.AgentMessage.update)?null:e.AgentMessage.update.PlanningDecisionUpdate.update}function te(e){let t=I(e);return!t||!("Started"in t)?null:t.Started}function re(e){let t=I(e);return!t||!("Completed"in t)?null:t.Completed}function ae(e){let t=I(e);return!t||!("PlanningRequired"in t)?null:t.PlanningRequired}function _e(e){return!("AgentMessage"in e)||!("StartingOrchestrator"in e.AgentMessage.update)?null:e.AgentMessage.update.StartingOrchestrator}function O(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)?null:e.AgentMessage.update.OrchestratorUpdate.update}function d(e){let t=O(e);return!t||!("ContextExplorerUpdate"in t)?null:t.ContextExplorerUpdate.update}function ne(e){let t=d(e);return!t||!("Started"in t)?null:t.Started}function ie(e){let t=d(e);return!t||!("Completed"in t)?null:t.Completed}function M(e){let t=d(e);return!t||!("WikiExplorerUpdate"in t)?null:t.WikiExplorerUpdate.update}function pe(e){let t=M(e);return!t||!("Started"in t)?null:t.Started}function oe(e){let t=M(e);return!t||!("Completed"in t)?null:t.Completed}function se(e){let t=M(e);return!t||!("WikiInfoGenerated"in t)?null:t.WikiInfoGenerated}function S(e){let t=d(e);return!t||!("SchemaTasksGenerationUpdate"in t)?null:t.SchemaTasksGenerationUpdate.update}function ue(e){let t=S(e);return!t||!("Started"in t)?null:t.Started}function ye(e){let t=S(e);return!t||!("Completed"in t)?null:t.Completed}function de(e){let t=S(e);return!t||!("TasksGenerated"in t)?null:t.TasksGenerated}function y(e){let t=d(e);return!t||!("SchemaExplorerUpdate"in t)?null:t.SchemaExplorerUpdate.update}function ce(e){let t=y(e);return!t||!("Started"in t)?null:t.Started}function le(e){let t=y(e);return!t||!("Completed"in t)?null:t.Completed}function me(e){let t=y(e);return!t||!("CodeExecutionComplete"in t)?null:t.CodeExecutionComplete}function be(e){let t=y(e);return!t||!("CodeOutputAnalyzed"in t)?null:t.CodeOutputAnalyzed}function Ie(e){let t=y(e);return!t||!("GeneratedCode"in t)?null:t.GeneratedCode}function Me(e){let t=y(e);return!t||!("SchemaExplored"in t)?null:t.SchemaExplored}function g(e){let t=O(e);return!t||!("StepUpdate"in t)?null:t.StepUpdate}function Se(e){let t=g(e);return!t||!("Programmer"in t.update)?null:t.update.Programmer}function ge(e){let t=g(e);return!t||!("UiProgrammer"in t.update)?null:t.update.UiProgrammer}function he(e){let t=g(e);return!t||!("SavedProgramRunner"in t.update)?null:t.update.SavedProgramRunner}0&&(module.exports={PromptQLSdk,createApolloClient,createPromptQLAuthTokenGenerator,diffThreadEvents,getAgentGeneratedResponse,getAgentInteractionDecisionAcceptInteractionEvent,getAgentInteractionDecisionDeclineInteractionEvent,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,getUserCancelEvent,getUserMessageEvent,isEnrichTokenMutationResponse,isLuxAuthPromptQLTokenFailedResponse,isLuxAuthPromptQLTokenSuccessResponse});
|
|
1
|
+
"use strict";var S=Object.defineProperty;var Ne=Object.getOwnPropertyDescriptor;var Ce=Object.getOwnPropertyNames;var Ue=Object.prototype.hasOwnProperty;var Ve=(n,e)=>{for(var i in e)S(n,i,{get:e[i],enumerable:!0})},Me=(n,e,i,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let d of Ce(e))!Ue.call(n,d)&&d!==i&&S(n,d,{get:()=>e[d],enumerable:!(r=Ne(e,d))||r.enumerable});return n};var Fe=n=>Me(S({},"__esModule",{value:!0}),n);var vn={};Ve(vn,{PromptQLSdk:()=>X,ROOM_NAME_REGEX:()=>Be,USER_AGENT:()=>H,buildAuthHeader:()=>m,cancelAgentMessage:()=>R,createApolloClient:()=>J,createRoom:()=>V,createWikiPage:()=>L,deleteWikiPage:()=>$,diffThreadEvents:()=>Ge,downloadArtifactData:()=>P,getAgentGeneratedResponse:()=>Ke,getAgentInteractionDecisionAcceptInteractionEvent:()=>Je,getAgentInteractionDecisionDeclineInteractionEvent:()=>He,getAgentInteractionFinishedEvent:()=>Bn,getAgentMessageProcessingStartedEvent:()=>$e,getAgentOrchestratorContextExplorerCompletedEvent:()=>dn,getAgentOrchestratorContextExplorerStartedEvent:()=>nn,getAgentOrchestratorContextExplorerUpdateEvent:()=>p,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent:()=>pn,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent:()=>mn,getAgentOrchestratorSchemaExplorerCompletedEvent:()=>sn,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent:()=>fn,getAgentOrchestratorSchemaExplorerSchemaExploredEvent:()=>cn,getAgentOrchestratorSchemaExplorerStartedEvent:()=>un,getAgentOrchestratorSchemaExplorerUpdateEvent:()=>s,getAgentOrchestratorSchemaTasksGeneratedEvent:()=>on,getAgentOrchestratorSchemaTasksGenerationCompletedEvent:()=>ln,getAgentOrchestratorSchemaTasksGenerationStartedEvent:()=>_n,getAgentOrchestratorSchemaTasksGenerationUpdateEvent:()=>x,getAgentOrchestratorStepProgrammerEvent:()=>yn,getAgentOrchestratorStepSavedProgramRunnerEvent:()=>kn,getAgentOrchestratorStepUiProgrammerEvent:()=>gn,getAgentOrchestratorStepUpdateEvent:()=>v,getAgentOrchestratorUpdateEvent:()=>k,getAgentOrchestratorWikiExplorerCompletedEvent:()=>tn,getAgentOrchestratorWikiExplorerStartedEvent:()=>rn,getAgentOrchestratorWikiExplorerUpdateEvent:()=>B,getAgentOrchestratorWikiInfoGeneratedEvent:()=>an,getAgentPlanGenerationStartedEvent:()=>Qe,getAgentPlanStepGeneratedEvent:()=>Le,getAgentPlanningDecisionCompletedEvent:()=>Ze,getAgentPlanningDecisionPlanningRequiredEvent:()=>Ye,getAgentPlanningDecisionStartedEvent:()=>Xe,getAgentPlanningDecisionUpdateEvent:()=>g,getAgentStartingOrchestratorEvent:()=>en,getArtifactMetadata:()=>C,getProjectInfo:()=>U,getThread:()=>I,getThreadAndEvents:()=>q,getThreadEventMessageId:()=>xn,getThreadEvents:()=>c,getUserCancelEvent:()=>ze,getUserMessageEvent:()=>We,getWikiPage:()=>Q,isInteractionAnalyzing:()=>he,listArtifactMetadataByThreadId:()=>N,listRooms:()=>f,listThreads:()=>F,listWikiPages:()=>W,searchWikiPages:()=>z,sendThreadMessage:()=>w,startThread:()=>D,streamThreadMessageEvents:()=>G,subscribeThreadEvents:()=>j,updateWikiPage:()=>K,validateRoomName:()=>xe});module.exports=Fe(vn);var Z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},Y={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},ee={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},ne={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},ie={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},de={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},re={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},te={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},ae={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},_e={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetGuidePage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},le={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},oe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},ue={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},se={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},pe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},me={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},fe={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}},{kind:"Field",alias:{kind:"Name",value:"title"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"title",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"stub"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"stub",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"aliases"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"aliases",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"definition"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"definition",block:!1}}]}]}}]}}]},ce={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},ye={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},ge={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function P(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let Pe=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${Pe}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function N(n,e,i){let r=await n.query({query:te,variables:{threadId:i},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(d=>d.latest_version_object).map(d=>({project_id:e,artifact_id:d.artifact_id,artifact_type:d.latest_version_object.artifact_type,version:d.latest_version_object.version,title:d.latest_version_object.title,description:d.latest_version_object.description??null,user_id:d.latest_version_object.user_id,metadata:d.latest_version_object.artifact_metadata,created_at:d.latest_version_object.created_at,size_bytes:Number.parseInt(d.latest_version_object.size)})):[]}async function C(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let u=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${u}`)}return t.json()}async function U(n){return(await n.query({query:le,fetchPolicy:"no-cache"})).data?.get_project_info}function f(n,e){return n.query({query:oe,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function V(n,e){if(!e.name)throw new Error("Room name is required");let i=xe(e.name);if(i)throw new Error(i);return n.mutate({mutation:Y,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var Be=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,ke=80,xe=n=>{let e=n.trim();return e.length===0?null:e.length>ke?`Room name must be ${ke} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":Be.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};var l=require("rxjs");var ve=/^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;function M(n){if(n==null)return null;try{Number.parseInt(n)}catch{throw new Error("invalid threadEventId")}return n}function F(n,e){return n.query({query:ue,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function I(n,e){if(!e)throw new Error("threadId is required");return n.query({query:se,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function q(n,e,i){let r=Ee(e,i);return n.query({query:pe,variables:{id:e,eventsWhere:r.where,eventsLimit:r.limit,eventsOrdering:r.ordering},fetchPolicy:"no-cache"}).then(d=>d.data?.threads_v2_by_pk)}function D(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:ne,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function c(n,e,i){return n.query({query:me,variables:Ee(e,i),fetchPolicy:"no-cache"}).then(r=>r.data?.thread_events??[])}function w(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:ee,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function R(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:Z,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function j(n,e,i){if(!e)throw new Error("threadId is required");M(i);let r={thread_id:{_eq:e}};return i&&(r.thread_event_id={_gte:i}),n.subscribe({query:ge,variables:{where:r}}).pipe((0,l.map)(d=>{if(d.error)throw d.error;return d.data?.thread_events??[]}))}function G(n,e,i){if(!e)throw new Error("threadId is required");let r,d=M(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:d}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return(0,l.defer)(async()=>{let t=r?{messageId:i?.messageId,eventId:{_gt:r}}:a,u=await c(n,e,t);return u.length>0&&(r=u[u.length-1]?.thread_event_id),u}).pipe((0,l.repeat)({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),(0,l.takeWhile)(t=>he(t,i?.skipAnalysis),!0))}function he(n,e){for(let i=n.length-1;i>=0;i--){let r=n[i];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let d=r.event_data.AgentMessage.update;if("content"in d&&("interaction_finished"in d.content||e&&"interaction_update"in d.content&&"main_agent"in d.content.interaction_update&&"completed"in d.content.interaction_update.main_agent)||"InteractionFinished"in d||e&&"OrchestratorUpdate"in d&&"GeneratedResponse"in d.OrchestratorUpdate.update)return!1}return!0}function Ie(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var Ee=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=Ie(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var y=["guide","regular"];async function W(n,e){let i=e.namespace||"regular";if(!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),De(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.query,d={where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},order_by:e.order_by||e.ordering?{[e.order_by?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};r||(d.offset=e.offset,d.limit=e.limit);let a=await qe(n,d);return r?je(a,e):a}async function z(n,e){if(!e.query)throw new Error("query is required");return n.query({query:ye,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:r,metadata:d,page:{id:a,..._}})=>({..._,score:r,stable_id:d.id,slug:a,created_at:d.createdAt,last_modified_at:d.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function Q(n,e,i,r){if(i=i||"regular",!y.includes(i))throw new Error(`Invalid namespace. Expected one of: ${y}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(i==="guide")return Re(n,{project_id:e,page_id:r});let d={project_id:{_eq:e},deleted_at:{_is_null:!0}};return ve.test(r)?d.id={_eq:r}:d.page_id={_eq:r},we(n,{where:d})}function L(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:ie,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function K(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:de,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function $(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:re,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function qe(n,e){return n.query({query:fe,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:r,id:d,...a})=>({...a,stable_id:d,slug:r}))??[])}function De(n,e){return n.query({query:ae,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function we(n,e){let i=await n.query({query:ce,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(d=>({stable_id:d.id,slug:d.page_id,created_at:d.created_at,last_modified_at:d.last_modified_at,...d.content}))??[]);return i.length?i[0]:null}async function Re(n,e){let i=await n.query({query:_e,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title,details:d.details}))??[]);return i.length?i[0]:null}function je(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),r=n.filter(d=>!e.include_stub&&d.stub?!1:!!(!i||d.title.toLowerCase().includes(i)||d.definition&&d.definition.toLowerCase().includes(i)||d.aliases?.length&&d.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}var o=require("@apollo/client"),Oe=require("@apollo/client/link/context"),Te=require("@apollo/client/link/subscriptions"),Ae=require("graphql"),be=require("graphql-ws"),J=n=>{let e=new o.HttpLink({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},r=(0,be.createClient)({url:n.url,connectionParams:()=>i(),lazy:!0}),d=new Te.GraphQLWsLink(r),a=o.ApolloLink.split(({operationType:_})=>_===Ae.OperationTypeNode.SUBSCRIPTION,d,typeof n.headers=="object"?e:new Oe.SetContextLink(({headers:_})=>i(_)).concat(e));return{client:new o.ApolloClient({link:a,cache:new o.InMemoryCache}),wsClient:r}};var H="PromptQL TypeScript SDK";function Ge(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let r=BigInt(i.thread_event_id),d=e.length-1;for(;d>=0;d--){let a=e[d];if(BigInt(a?.thread_event_id)<=r)break}return e.slice(d+1)}function We(n){return"UserMessage"in n?n.UserMessage:null}function ze(n){return"UserCancel"in n?n.UserCancel:null}function Qe(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function Le(n){let e=k(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function Ke(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function $e(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function Je(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function He(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function g(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function Xe(n){let e=g(n);return!e||!("Started"in e)?null:e.Started}function Ze(n){let e=g(n);return!e||!("Completed"in e)?null:e.Completed}function Ye(n){let e=g(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function en(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function k(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function p(n){let e=k(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function nn(n){let e=p(n);return!e||!("Started"in e)?null:e.Started}function dn(n){let e=p(n);return!e||!("Completed"in e)?null:e.Completed}function B(n){let e=p(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function rn(n){let e=B(n);return!e||!("Started"in e)?null:e.Started}function tn(n){let e=B(n);return!e||!("Completed"in e)?null:e.Completed}function an(n){let e=B(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function x(n){let e=p(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function _n(n){let e=x(n);return!e||!("Started"in e)?null:e.Started}function ln(n){let e=x(n);return!e||!("Completed"in e)?null:e.Completed}function on(n){let e=x(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function s(n){let e=p(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function un(n){let e=s(n);return!e||!("Started"in e)?null:e.Started}function sn(n){let e=s(n);return!e||!("Completed"in e)?null:e.Completed}function pn(n){let e=s(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function mn(n){let e=s(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function fn(n){let e=s(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function cn(n){let e=s(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function v(n){let e=k(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function yn(n){let e=v(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function gn(n){let e=v(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function kn(n){let e=v(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Bn(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function xn(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function m(n){return{Authorization:`pat ${n}`,"User-Agent":H}}var Se="https://promptql.ddn.hasura.app",h=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||Se);i.pathname="/playground-v2-hge/v1/graphql";let{client:r,wsClient:d}=J({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(m(this.options.accessToken),this.options.headers)});this.wsClient=d,this.client=r}async getProjectInfo(){if(this.project)return this.project;let e=await U(this.client);if(!e)throw new Error("Project not found");let i=new URL(this.options.baseUrl||Se);return i.hostname.startsWith("promptql.")&&(i.hostname=`${e.projectName}${i.hostname.slice(8)}`),this.project={projectId:e.projectId,projectName:e.projectName,projectHost:i.toString(),promptqlConsoleUrl:e.promptqlConsoleUrl},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var E=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return N(this.api.client,i.projectId,e)}async download(e,i){let r=await this.api.getProjectInfo();return P(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let r=await this.api.getProjectInfo();return C(r.projectHost,e,i,m(this.api.options.accessToken),this.api.options.fetch)}};var O=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var T=class{api;constructor(e){this.api=e}async list(e){return f(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return f(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return V(this.api.client,e)}};var A=class{api;constructor(e){this.api=e}async list(e){return F(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return I(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return D(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return q(this.api.client,e,i)}async getEvents(e,i){return c(this.api.client,e,i)}async sendMessage(e){return w(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return R(this.api.client,e)}subscribeEvents(e,i){return j(this.api.client,e,i)}streamMessageEvents(e,i){return G(this.api.client,e,i)}};var b=class{api;constructor(e){this.api=e}async list(e){return W(this.api.client,e)}async search(e){return z(this.api.client,e)}async get(e,i){let r=await this.api.getProjectInfo();return Q(this.api.client,r.projectId,e,i)}async create(e){return L(this.api.client,e)}async update(e,i){return K(this.api.client,e,i)}async delete(e){return $(this.api.client,e)}};var X=class{constructor(e){let i=new h(e);this.api=i,this.thread=new A(i),this.project=new O(i),this.room=new T(i),this.artifact=new E(i),this.wiki=new b(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};0&&(module.exports={PromptQLSdk,ROOM_NAME_REGEX,USER_AGENT,buildAuthHeader,cancelAgentMessage,createApolloClient,createRoom,createWikiPage,deleteWikiPage,diffThreadEvents,downloadArtifactData,getAgentGeneratedResponse,getAgentInteractionDecisionAcceptInteractionEvent,getAgentInteractionDecisionDeclineInteractionEvent,getAgentInteractionFinishedEvent,getAgentMessageProcessingStartedEvent,getAgentOrchestratorContextExplorerCompletedEvent,getAgentOrchestratorContextExplorerStartedEvent,getAgentOrchestratorContextExplorerUpdateEvent,getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,getAgentOrchestratorSchemaExplorerCompletedEvent,getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,getAgentOrchestratorSchemaExplorerSchemaExploredEvent,getAgentOrchestratorSchemaExplorerStartedEvent,getAgentOrchestratorSchemaExplorerUpdateEvent,getAgentOrchestratorSchemaTasksGeneratedEvent,getAgentOrchestratorSchemaTasksGenerationCompletedEvent,getAgentOrchestratorSchemaTasksGenerationStartedEvent,getAgentOrchestratorSchemaTasksGenerationUpdateEvent,getAgentOrchestratorStepProgrammerEvent,getAgentOrchestratorStepSavedProgramRunnerEvent,getAgentOrchestratorStepUiProgrammerEvent,getAgentOrchestratorStepUpdateEvent,getAgentOrchestratorUpdateEvent,getAgentOrchestratorWikiExplorerCompletedEvent,getAgentOrchestratorWikiExplorerStartedEvent,getAgentOrchestratorWikiExplorerUpdateEvent,getAgentOrchestratorWikiInfoGeneratedEvent,getAgentPlanGenerationStartedEvent,getAgentPlanStepGeneratedEvent,getAgentPlanningDecisionCompletedEvent,getAgentPlanningDecisionPlanningRequiredEvent,getAgentPlanningDecisionStartedEvent,getAgentPlanningDecisionUpdateEvent,getAgentStartingOrchestratorEvent,getArtifactMetadata,getProjectInfo,getThread,getThreadAndEvents,getThreadEventMessageId,getThreadEvents,getUserCancelEvent,getUserMessageEvent,getWikiPage,isInteractionAnalyzing,listArtifactMetadataByThreadId,listRooms,listThreads,listWikiPages,searchWikiPages,sendThreadMessage,startThread,streamThreadMessageEvents,subscribeThreadEvents,updateWikiPage,validateRoomName});
|
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function d(e){return e=e?e.trim():"",e?e[e.length-1]==="/"?e.slice(0,e.length-1):e:""}function g(e){return e!=null&&typeof e=="object"&&"status"in e&&e.status==="failure"}function h(e){return e!=null&&typeof e=="object"&&"status"in e&&e.status==="success"&&"token"in e}function f(e){return e!=null&&typeof e=="object"&&("data"in e&&!!e.data&&typeof e.data=="object"&&"enrich_token"in e.data&&!!e.data.enrich_token&&typeof e.data.enrich_token=="object"&&"userDirectoryJWT"in e.data.enrich_token||"errors"in e&&Array.isArray(e.errors))}function x(e){let r=`${d(e.authHost)||"https://auth.pro.hasura.io"}/ddn/promptql/token`,_={token:"",expiry:new Date(0)},a=e.fetch||fetch,o=async()=>{let n=await a(r,{method:"POST",headers:{Authorization:`pat ${e.serviceAccountToken}`}});switch(n.status){case 200:{let i=await n.json();if(h(i))return i;throw new Error("malformed token response")}case 401:{let i=await n.json();throw g(i)?new Error(i?.error||n.statusText):new Error(n.statusText)}default:{let i=await n.text();throw new Error(i)}}},s=async n=>{let i=await a(e.promptqlGraphQLUrl,{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:n.token,projectId:e.projectId},operationName:"EnrichToken"})});switch(i.status){case 200:{let p=await i.json();if(!f(p)||!p.data?.enrich_token?.userDirectoryJWT)throw new Error(`malformed promptql token response: ${JSON.stringify(p)}`);return p.data.enrich_token.userDirectoryJWT}default:{let p=await i.text();throw new Error(p)}}};return async()=>{if(_.expiry.getTime()<=Date.now()-1e3){let n=await o(),i=await s(n);_.token=i;let p=new Date(n.expiry);if(Number.isNaN(p.getTime())){let S=new Date;S.setHours(1),_.expiry=S}else _.expiry=p}return _.token}}import{ApolloClient as R,ApolloLink as U,HttpLink as w,InMemoryCache as V}from"@apollo/client";import{SetContextLink as W}from"@apollo/client/link/context";import{GraphQLWsLink as F}from"@apollo/client/link/subscriptions";import{OperationTypeNode as N}from"graphql";import{createClient as j}from"graphql-ws";var A=e=>{let t=new w({uri:e.url,fetch:e.fetch,headers:e.headers}),r=async s=>{let n=await e.getAuthToken();return{headers:{...s,Authorization:`Bearer ${n}`}}},_=new F(j({url:e.url,connectionParams:()=>r(e.headers)})),a=new W(({headers:s})=>r(s)),o=U.split(({operationType:s})=>s===N.SUBSCRIPTION,_,a.concat(t));return new R({link:o,cache:new V})};var B={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"}}}],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"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},k={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"}}}],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"}}}],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"}}]}}]}}]},v={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},arguments:[{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},O={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"}}]}}]}}]},C={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"}}]}}]}}]},T={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:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]};var c=class{_options;constructor(t){this._options=t}info(){return this._options.client.query({query:v,variables:{projectId:this._options.projectId}}).then(t=>{if(!t.data?.get_project_info)throw new Error(t.error?.message||"Project not found");return t.data.get_project_info})}};import{map as q,takeWhile as z}from"rxjs/operators";var l=class{_options;constructor(t){this._options=t}list(t){return this._options.client.query({query:O,variables:{...t,limit:t.limit&&t.limit>0?t.limit:10},fetchPolicy:"no-cache"}).then(r=>r.data?.threads_v2??[])}get(t){if(!t)throw new Error("threadId is required");return this._options.client.query({query:C,variables:{id:t},fetchPolicy:"no-cache"}).then(r=>r.data?.threads_v2_by_pk)}start(t){if(!t.message.trim())throw new Error("message must not be empty");return this._options.client.mutate({mutation:k,variables:{...t,projectId:this._options.projectId,buildId:t.buildId||this._options.buildId,timezone:t.timezone||this._options.defaultTimezone}}).then(r=>{if(!r.data?.start_thread)throw new Error(r.error?.message||"Failed to start thread");return r.data.start_thread})}sendMessage(t){if(!t.threadId)throw new Error("threadId is required");if(!t.message.trim())throw new Error("message must not be empty");return this._options.client.mutate({mutation:B,variables:{...t,timezone:t.timezone||this._options.defaultTimezone}}).then(r=>{if(!r.data?.send_thread_message)throw new Error(r.error?.message||"Failed to continue thread");return r.data.send_thread_message})}subscribeEvents(t,r){if(!t)throw new Error("threadId is required");if(r!=null)try{Number.parseInt(r)}catch{throw new Error("invalid threadEventId")}let _={thread_id:{_eq:t}};return r&&(_.thread_event_id={_gte:r}),this._options.client.subscribe({query:T,variables:{where:_}}).pipe(q(a=>{if(a.error)throw a.error;return a.data?.thread_events??[]}))}streamEvents(t,r){return this.subscribeEvents(t,r).pipe(z(_=>{for(let a=_.length-1;a>0;a--){let o=_[a];if("AgentMessage"in o.event_data&&"InteractionFinished"in o.event_data.AgentMessage.update)return!1}return!0},!0))}};var E=class{constructor(t){let r=d(t.promptqlBaseUrl)||"https://promptql.ddn.hasura.app";if(!t.projectId)throw new Error("projectId must not be empty. You can find it in Project Settings > General Settings tab on https://promptql.console.hasura.io.");if(!t.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");let _=r.endsWith("/v1/graphql")?r:`${r}/playground-v2-hge/v1/graphql`,a=x({promptqlGraphQLUrl:_,authHost:t.authHost,projectId:t.projectId,serviceAccountToken:t.serviceAccountToken,fetch:t.fetch});this._options={projectId:t.projectId,buildId:t.buildId,client:A({getAuthToken:a,url:_,fetch:t.fetch,headers:t.headers}),defaultTimezone:t.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone},this.thread=new l(this._options),this.project=new c(this._options)}_options;thread;project};function be(e,t){if(!t.length)return[];if(!e.length)return t;let r=e[e.length-1];if(!r)return t;let _=BigInt(r.thread_event_id),a=t.length-1;for(;a>=0;a--){let o=t[a];if(BigInt(o?.thread_event_id)<=_)break}return t.slice(a+1)}function Ie(e){return"UserMessage"in e?e.UserMessage:null}function Me(e){return"UserCancel"in e?e.UserCancel:null}function Se(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("PlanGenerationStarted"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function ge(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("PlanStepGenerated"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.PlanStepGenerated}function he(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)||!("GeneratedResponse"in e.AgentMessage.update.OrchestratorUpdate.update)?null:e.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse}function fe(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("ProcessingStarted"in e.AgentMessage.update.MessageProcessingUpdate.update)?null:e.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function xe(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("InteractionDecision"in e.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function Ae(e){return!("AgentMessage"in e)||!("MessageProcessingUpdate"in e.AgentMessage.update)||!("InteractionDecision"in e.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:e.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function m(e){return!("AgentMessage"in e)||!("PlanningDecisionUpdate"in e.AgentMessage.update)?null:e.AgentMessage.update.PlanningDecisionUpdate.update}function Be(e){let t=m(e);return!t||!("Started"in t)?null:t.Started}function ke(e){let t=m(e);return!t||!("Completed"in t)?null:t.Completed}function ve(e){let t=m(e);return!t||!("PlanningRequired"in t)?null:t.PlanningRequired}function Oe(e){return!("AgentMessage"in e)||!("StartingOrchestrator"in e.AgentMessage.update)?null:e.AgentMessage.update.StartingOrchestrator}function P(e){return!("AgentMessage"in e)||!("OrchestratorUpdate"in e.AgentMessage.update)?null:e.AgentMessage.update.OrchestratorUpdate.update}function y(e){let t=P(e);return!t||!("ContextExplorerUpdate"in t)?null:t.ContextExplorerUpdate.update}function Ce(e){let t=y(e);return!t||!("Started"in t)?null:t.Started}function Te(e){let t=y(e);return!t||!("Completed"in t)?null:t.Completed}function b(e){let t=y(e);return!t||!("WikiExplorerUpdate"in t)?null:t.WikiExplorerUpdate.update}function Ee(e){let t=b(e);return!t||!("Started"in t)?null:t.Started}function Pe(e){let t=b(e);return!t||!("Completed"in t)?null:t.Completed}function Re(e){let t=b(e);return!t||!("WikiInfoGenerated"in t)?null:t.WikiInfoGenerated}function I(e){let t=y(e);return!t||!("SchemaTasksGenerationUpdate"in t)?null:t.SchemaTasksGenerationUpdate.update}function Ue(e){let t=I(e);return!t||!("Started"in t)?null:t.Started}function we(e){let t=I(e);return!t||!("Completed"in t)?null:t.Completed}function Ve(e){let t=I(e);return!t||!("TasksGenerated"in t)?null:t.TasksGenerated}function u(e){let t=y(e);return!t||!("SchemaExplorerUpdate"in t)?null:t.SchemaExplorerUpdate.update}function We(e){let t=u(e);return!t||!("Started"in t)?null:t.Started}function Fe(e){let t=u(e);return!t||!("Completed"in t)?null:t.Completed}function Ne(e){let t=u(e);return!t||!("CodeExecutionComplete"in t)?null:t.CodeExecutionComplete}function je(e){let t=u(e);return!t||!("CodeOutputAnalyzed"in t)?null:t.CodeOutputAnalyzed}function qe(e){let t=u(e);return!t||!("GeneratedCode"in t)?null:t.GeneratedCode}function ze(e){let t=u(e);return!t||!("SchemaExplored"in t)?null:t.SchemaExplored}function M(e){let t=P(e);return!t||!("StepUpdate"in t)?null:t.StepUpdate}function Ge(e){let t=M(e);return!t||!("Programmer"in t.update)?null:t.update.Programmer}function De(e){let t=M(e);return!t||!("UiProgrammer"in t.update)?null:t.update.UiProgrammer}function Qe(e){let t=M(e);return!t||!("SavedProgramRunner"in t.update)?null:t.update.SavedProgramRunner}export{E as PromptQLSdk,A as createApolloClient,x as createPromptQLAuthTokenGenerator,be as diffThreadEvents,he as getAgentGeneratedResponse,xe as getAgentInteractionDecisionAcceptInteractionEvent,Ae as getAgentInteractionDecisionDeclineInteractionEvent,fe as getAgentMessageProcessingStartedEvent,Te as getAgentOrchestratorContextExplorerCompletedEvent,Ce as getAgentOrchestratorContextExplorerStartedEvent,y as getAgentOrchestratorContextExplorerUpdateEvent,Ne as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,je as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Fe as getAgentOrchestratorSchemaExplorerCompletedEvent,qe as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,ze as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,We as getAgentOrchestratorSchemaExplorerStartedEvent,u as getAgentOrchestratorSchemaExplorerUpdateEvent,Ve as getAgentOrchestratorSchemaTasksGeneratedEvent,we as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Ue as getAgentOrchestratorSchemaTasksGenerationStartedEvent,I as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,Ge as getAgentOrchestratorStepProgrammerEvent,Qe as getAgentOrchestratorStepSavedProgramRunnerEvent,De as getAgentOrchestratorStepUiProgrammerEvent,M as getAgentOrchestratorStepUpdateEvent,P as getAgentOrchestratorUpdateEvent,Pe as getAgentOrchestratorWikiExplorerCompletedEvent,Ee as getAgentOrchestratorWikiExplorerStartedEvent,b as getAgentOrchestratorWikiExplorerUpdateEvent,Re as getAgentOrchestratorWikiInfoGeneratedEvent,Se as getAgentPlanGenerationStartedEvent,ge as getAgentPlanStepGeneratedEvent,ke as getAgentPlanningDecisionCompletedEvent,ve as getAgentPlanningDecisionPlanningRequiredEvent,Be as getAgentPlanningDecisionStartedEvent,m as getAgentPlanningDecisionUpdateEvent,Oe as getAgentStartingOrchestratorEvent,Me as getUserCancelEvent,Ie as getUserMessageEvent,f as isEnrichTokenMutationResponse,g as isLuxAuthPromptQLTokenFailedResponse,h as isLuxAuthPromptQLTokenSuccessResponse};
|
|
1
|
+
import{a as b,c as B}from"./chunk-WIDMKT3J.mjs";var S={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CancelAgentMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"messageId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"cancel_agent_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"agentMessageId"},value:{kind:"Variable",name:{kind:"Name",value:"messageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},P={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateRoom"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"name"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"description"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"create_room"},arguments:[{kind:"Argument",name:{kind:"Name",value:"name"},value:{kind:"Variable",name:{kind:"Name",value:"name"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"description"},value:{kind:"Variable",name:{kind:"Name",value:"description"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}}]}}]}}]},C={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"SendThreadMessage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"send_thread_message"},arguments:[{kind:"Argument",name:{kind:"Name",value:"threadId"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}}]}}]}}]},N={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"StartThread"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"message"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"projectId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"timezone"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"roomId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"uploads"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"UserUploadInput"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"visibility"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"start_thread"},arguments:[{kind:"Argument",name:{kind:"Name",value:"message"},value:{kind:"Variable",name:{kind:"Name",value:"message"}}},{kind:"Argument",name:{kind:"Name",value:"projectId"},value:{kind:"Variable",name:{kind:"Name",value:"projectId"}}},{kind:"Argument",name:{kind:"Name",value:"timezone"},value:{kind:"Variable",name:{kind:"Name",value:"timezone"}}},{kind:"Argument",name:{kind:"Name",value:"buildId"},value:{kind:"Variable",name:{kind:"Name",value:"buildId"}}},{kind:"Argument",name:{kind:"Name",value:"buildFqdn"},value:{kind:"Variable",name:{kind:"Name",value:"buildFqdn"}}},{kind:"Argument",name:{kind:"Name",value:"roomId"},value:{kind:"Variable",name:{kind:"Name",value:"roomId"}}},{kind:"Argument",name:{kind:"Name",value:"uploads"},value:{kind:"Variable",name:{kind:"Name",value:"uploads"}}},{kind:"Argument",name:{kind:"Name",value:"visibility"},value:{kind:"Variable",name:{kind:"Name",value:"visibility"}}},{kind:"Argument",name:{kind:"Name",value:"createdFrom"},value:{kind:"Variable",name:{kind:"Name",value:"createdFrom"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"thread_event_id"}}]}}]}}]}}]},U={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"CreateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageId"}},type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_add"},arguments:[{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}},{kind:"Argument",name:{kind:"Name",value:"pageId"},value:{kind:"Variable",name:{kind:"Name",value:"pageId"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}}]}}]}}]},V={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"UpdateWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"pageContent"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"jsonb"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_update"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}},{kind:"Argument",name:{kind:"Name",value:"pageContent"},value:{kind:"Variable",name:{kind:"Name",value:"pageContent"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},M={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"mutation",name:{kind:"Name",value:"DeleteWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_delete"},arguments:[{kind:"Argument",name:{kind:"Name",value:"id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"buildVersion"}}]}}]}}]},F={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetArtifactsByThreadId"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"threadId"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifacts"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_artifacts"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"threadId"}}}]}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"updated_at"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"artifact_id"}},{kind:"Field",name:{kind:"Name",value:"latest_version_object"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"artifact_metadata"}},{kind:"Field",name:{kind:"Name",value:"artifact_type"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"size"}},{kind:"Field",name:{kind:"Name",value:"version"}}]}}]}}]}}]},I={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListGuidePages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_guide_page_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetGuidePage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"project_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"page_id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_guide_page"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"project_id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"project_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"id"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_eq"},value:{kind:"Variable",name:{kind:"Name",value:"page_id"}}}]}},{kind:"ObjectField",name:{kind:"Name",value:"deleted_at"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"_is_null"},value:{kind:"BooleanValue",value:!0}}]}}]}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_title"}},{kind:"Field",name:{kind:"Name",value:"details"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},D={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetProjectInfo"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"get_project_info"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"projectId"}},{kind:"Field",name:{kind:"Name",value:"projectName"}},{kind:"Field",name:{kind:"Name",value:"promptqlConsoleUrl"}}]}}]}}]},w={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetRooms"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"rooms_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}},defaultValue:{kind:"IntValue",value:"10"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"rooms"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Room"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Room"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"rooms"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"room_id"}},{kind:"Field",name:{kind:"Name",value:"name"}},{kind:"Field",name:{kind:"Name",value:"description"}},{kind:"Field",name:{kind:"Name",value:"project_id"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"user_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}}]}}]},R={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreads"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"threads_v2_order_by"}}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},j={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},G={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadAndEventsById"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"id"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"uuid"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"threads_v2_by_pk"},arguments:[{kind:"Argument",name:{kind:"Name",value:"thread_id"},value:{kind:"Variable",name:{kind:"Name",value:"id"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"Thread"}},{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"eventsWhere"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"eventsLimit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"eventsOrdering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"Thread"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"threads_v2"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_id"}},{kind:"Field",name:{kind:"Name",value:"build_id"}},{kind:"Field",name:{kind:"Name",value:"title"}},{kind:"Field",name:{kind:"Name",value:"relevant_event_count"}},{kind:"Field",name:{kind:"Name",value:"visibility"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"updated_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},W={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"ordering"}},type:{kind:"NamedType",name:{kind:"Name",value:"order_by"}},defaultValue:{kind:"EnumValue",value:"asc"}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"Variable",name:{kind:"Name",value:"ordering"}}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]},z={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"ListWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"order_by"}},type:{kind:"ListType",type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_order_by"}}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"Variable",name:{kind:"Name",value:"order_by"}}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}},{kind:"Field",alias:{kind:"Name",value:"title"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"title",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"stub"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"stub",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"aliases"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"aliases",block:!1}}]},{kind:"Field",alias:{kind:"Name",value:"definition"},name:{kind:"Name",value:"content"},arguments:[{kind:"Argument",name:{kind:"Name",value:"path"},value:{kind:"StringValue",value:"definition",block:!1}}]}]}}]}}]},Q={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"GetWikiPage"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"admin_wiki_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki"},arguments:[{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"IntValue",value:"1"}},{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"page_id"}},{kind:"Field",name:{kind:"Name",value:"content"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"last_modified_at"}}]}}]}}]},L={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"query",name:{kind:"Name",value:"SearchWikiPages"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"query"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"String"}}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"offset"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}},{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"limit"}},type:{kind:"NamedType",name:{kind:"Name",value:"Int"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"admin_wiki_search"},arguments:[{kind:"Argument",name:{kind:"Name",value:"query"},value:{kind:"Variable",name:{kind:"Name",value:"query"}}},{kind:"Argument",name:{kind:"Name",value:"offset"},value:{kind:"Variable",name:{kind:"Name",value:"offset"}}},{kind:"Argument",name:{kind:"Name",value:"limit"},value:{kind:"Variable",name:{kind:"Name",value:"limit"}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"totalCount"}},{kind:"Field",name:{kind:"Name",value:"results"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"score"}},{kind:"Field",name:{kind:"Name",value:"page"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"aliases"}},{kind:"Field",name:{kind:"Name",value:"definition"}},{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"namespace"}},{kind:"Field",name:{kind:"Name",value:"stub"}},{kind:"Field",name:{kind:"Name",value:"title"}}]}},{kind:"Field",name:{kind:"Name",value:"metadata"},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"id"}},{kind:"Field",name:{kind:"Name",value:"createdAt"}},{kind:"Field",name:{kind:"Name",value:"ownerId"}},{kind:"Field",name:{kind:"Name",value:"lastUpdatedAt"}}]}}]}}]}}]}}]},K={kind:"Document",definitions:[{kind:"OperationDefinition",operation:"subscription",name:{kind:"Name",value:"SubscribeThreadEvents"},variableDefinitions:[{kind:"VariableDefinition",variable:{kind:"Variable",name:{kind:"Name",value:"where"}},type:{kind:"NonNullType",type:{kind:"NamedType",name:{kind:"Name",value:"thread_events_bool_exp"}}}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_events"},arguments:[{kind:"Argument",name:{kind:"Name",value:"where"},value:{kind:"Variable",name:{kind:"Name",value:"where"}}},{kind:"Argument",name:{kind:"Name",value:"order_by"},value:{kind:"ObjectValue",fields:[{kind:"ObjectField",name:{kind:"Name",value:"thread_event_id"},value:{kind:"EnumValue",value:"asc"}}]}}],selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadEvent"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadEvent"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"thread_events"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"thread_event_id"}},{kind:"Field",name:{kind:"Name",value:"event_data"}},{kind:"Field",name:{kind:"Name",value:"created_at"}},{kind:"Field",name:{kind:"Name",value:"user"},selectionSet:{kind:"SelectionSet",selections:[{kind:"FragmentSpread",name:{kind:"Name",value:"ThreadUserInfo"}}]}}]}},{kind:"FragmentDefinition",name:{kind:"Name",value:"ThreadUserInfo"},typeCondition:{kind:"NamedType",name:{kind:"Name",value:"promptql_users"}},selectionSet:{kind:"SelectionSet",selections:[{kind:"Field",name:{kind:"Name",value:"promptql_user_id"}},{kind:"Field",name:{kind:"Name",value:"display_name"}}]}}]};async function $(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/data`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let Be=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to download artifact: ${Be}`)}return t.body?t.headers.get("Content-Type")?.startsWith("application/json")?t.json():t.text():null}async function J(n,e,i){let r=await n.query({query:F,variables:{threadId:i},fetchPolicy:"no-cache"});return r.data?.artifacts?.length?r.data.artifacts.filter(d=>d.latest_version_object).map(d=>({project_id:e,artifact_id:d.artifact_id,artifact_type:d.latest_version_object.artifact_type,version:d.latest_version_object.version,title:d.latest_version_object.title,description:d.latest_version_object.description??null,user_id:d.latest_version_object.user_id,metadata:d.latest_version_object.artifact_metadata,created_at:d.latest_version_object.created_at,size_bytes:Number.parseInt(d.latest_version_object.size)})):[]}async function H(n,e,i,r,d){let a=`${n}/promptql-v2/artifacts/${e}/version/${i}/metadata`,t=await(typeof d=="function"?d:fetch)(a,{method:"GET",headers:r});if(t.status!==200){let l=t.body?await t.text():t.statusText;throw new Error(`[${t.status}] failed to get artifact metadata: ${l}`)}return t.json()}async function X(n){return(await n.query({query:D,fetchPolicy:"no-cache"})).data?.get_project_info}function x(n,e){return n.query({query:w,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.rooms??[])}function Y(n,e){if(!e.name)throw new Error("Room name is required");let i=ve(e.name);if(i)throw new Error(i);return n.mutate({mutation:P,variables:e,fetchPolicy:"no-cache"}).then(r=>{if(!r.data?.create_room?.room_id)throw new Error("expected room_id in response, got null");return r.data?.create_room?.room_id})}var xe=/^[\p{Ll}\p{Lo}\p{N}]+([_-][\p{Ll}\p{Lo}\p{N}]+)*$/u,Z=80,ve=n=>{let e=n.trim();return e.length===0?null:e.length>Z?`Room name must be ${Z} characters or less`:/[^\p{Ll}\p{Lo}\p{N}_-]/u.test(e)?"Only lowercase letters, numbers, hyphens, and underscores are allowed.":/^[_-]|[_-]$/.test(e)?"Room name should not start or end with a hyphen or underscore.":/[-_]{2,}/.test(e)?"Room name should not contain consecutive hyphens or underscores.":xe.test(e)?null:"Room name is invalid. Only lowercase letters, numbers, hyphens, and underscores are allowed."};import{defer as he,map as Ee,repeat as Oe,takeWhile as Te}from"rxjs";function ee(n,e){return n.query({query:R,variables:{...e,limit:e.limit&&e.limit>0?e.limit:10},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2??[])}function ne(n,e){if(!e)throw new Error("threadId is required");return n.query({query:j,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.threads_v2_by_pk)}function ie(n,e,i){let r=le(e,i);return n.query({query:G,variables:{id:e,eventsWhere:r.where,eventsLimit:r.limit,eventsOrdering:r.ordering},fetchPolicy:"no-cache"}).then(d=>d.data?.threads_v2_by_pk)}function de(n,e){if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:N,variables:e}).then(i=>{if(!i.data?.start_thread)throw new Error(i.error?.message||"Failed to start thread");return i.data.start_thread})}function v(n,e,i){return n.query({query:W,variables:le(e,i),fetchPolicy:"no-cache"}).then(r=>r.data?.thread_events??[])}function re(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.message.trim())throw new Error("message must not be empty");return n.mutate({mutation:C,variables:e}).then(i=>{if(!i.data?.send_thread_message)throw new Error(i.error?.message||"Failed to send message to thread");return i.data.send_thread_message})}function te(n,e){if(!e.threadId)throw new Error("threadId is required");if(!e.messageId.trim())throw new Error("messageId is required");return n.mutate({mutation:S,variables:e}).then(i=>{if(!i.data?.cancel_agent_message)throw new Error(i.error?.message||"Failed to cancel thread");return i.data.cancel_agent_message.thread_event_id})}function ae(n,e,i){if(!e)throw new Error("threadId is required");B(i);let r={thread_id:{_eq:e}};return i&&(r.thread_event_id={_gte:i}),n.subscribe({query:K,variables:{where:r}}).pipe(Ee(d=>{if(d.error)throw d.error;return d.data?.thread_events??[]}))}function _e(n,e,i){if(!e)throw new Error("threadId is required");let r,d=B(i?.fromEventId),a={eventId:i?.fromEventId?{_gte:d}:void 0,messageId:i?.messageId},_=i?.pollingInterval&&i?.pollingInterval>0?i.pollingInterval:5;return he(async()=>{let t=r?{messageId:i?.messageId,eventId:{_gt:r}}:a,l=await v(n,e,t);return l.length>0&&(r=l[l.length-1]?.thread_event_id),l}).pipe(Oe({count:i?.timeout&&i.timeout>0?Math.ceil(i.timeout/_):void 0,delay:_*1e3}),Te(t=>Ae(t,i?.skipAnalysis),!0))}function Ae(n,e){for(let i=n.length-1;i>=0;i--){let r=n[i];if("UserMessage"in r.event_data)return!0;if(!("AgentMessage"in r.event_data))return!1;let d=r.event_data.AgentMessage.update;if("content"in d&&("interaction_finished"in d.content||e&&"interaction_update"in d.content&&"main_agent"in d.content.interaction_update&&"completed"in d.content.interaction_update.main_agent)||"InteractionFinished"in d||e&&"OrchestratorUpdate"in d&&"GeneratedResponse"in d.OrchestratorUpdate.update)return!1}return!0}function be(n){return[{event_data:{_contains:{UserMessage:{message_id:n}}}},{event_data:{_contains:{AgentMessage:{message_id:n}}}},{event_data:{_contains:{UserCancel:{message_id:n}}}}]}var le=(n,e)=>{if(!n)throw new Error("threadId is required");let i={thread_id:{_eq:n}};return e&&(e.eventId&&(i.thread_event_id=e.eventId),e.messageId&&(i._or=be(e.messageId))),{where:i,limit:e?.limit,ordering:e?.ordering||"asc"}};var p=["guide","regular"];async function oe(n,e){let i=e.namespace||"regular";if(!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(i==="guide"){let _={deleted_at:{_is_null:!0}};return e.project_id&&(_.project_id={_eq:e.project_id}),e.query&&(_.page_title={_ilike:e.query.toLowerCase()}),Pe(n,{where:_,limit:e.limit,offset:e.offset,order_by:e.order_by||e.ordering?{[!e.order_by||e.order_by==="slug"?"id":e.order_by]:e.ordering||"asc"}:void 0})}let r=e.project_id||!e.include_stub||e.namespace||e.query,d={where:e.project_id?{project_id:{_eq:e.project_id},deleted_at:{_is_null:!0}}:{},order_by:e.order_by||e.ordering?{[e.order_by?e.order_by==="slug"?"page_id":e.order_by:"page_id"]:e.ordering||"asc"}:void 0};r||(d.offset=e.offset,d.limit=e.limit);let a=await Se(n,d);return r?Ue(a,e):a}async function ue(n,e){if(!e.query)throw new Error("query is required");return n.query({query:L,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_search?{totalCount:i.data.admin_wiki_search.totalCount,results:i.data?.admin_wiki_search.results.map(({score:r,metadata:d,page:{id:a,..._}})=>({..._,score:r,stable_id:d.id,slug:a,created_at:d.createdAt,last_modified_at:d.lastUpdatedAt}))}:{totalCount:0,results:[]})}async function se(n,e,i,r){if(i=i||"regular",!p.includes(i))throw new Error(`Invalid namespace. Expected one of: ${p}`);if(!e)throw new Error("projectId is required");if(!r)throw new Error("identifier is required");if(i==="guide")return Ne(n,{project_id:e,page_id:r});let d={project_id:{_eq:e},deleted_at:{_is_null:!0}};return b.test(r)?d.id={_eq:r}:d.page_id={_eq:r},Ce(n,{where:d})}function pe(n,{slug:e,...i}){if(!i.title)throw new Error("Wiki title is required");if(!i.stub&&!i.definition)throw new Error("Wiki definition is required");return n.mutate({mutation:U,variables:{pageId:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_add?.id)}function me(n,e,i){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:V,variables:{id:e,pageContent:i},fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki_update?.buildVersion)}function fe(n,e){if(!e)throw new Error("ID of the wiki is required");return n.mutate({mutation:M,variables:{id:e},fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki_delete?.buildVersion)}function Se(n,e){return n.query({query:z,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_wiki.map(({page_id:r,id:d,...a})=>({...a,stable_id:d,slug:r}))??[])}function Pe(n,e){return n.query({query:I,variables:e,fetchPolicy:"no-cache"}).then(i=>i.data?.admin_guide_page?.map(r=>({stable_id:r.id,slug:r.id,created_at:r.created_at,last_modified_at:r.last_modified_at,title:r.page_title}))??[])}async function Ce(n,e){let i=await n.query({query:Q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_wiki.map(d=>({stable_id:d.id,slug:d.page_id,created_at:d.created_at,last_modified_at:d.last_modified_at,...d.content}))??[]);return i.length?i[0]:null}async function Ne(n,e){let i=await n.query({query:q,variables:e,fetchPolicy:"no-cache"}).then(r=>r.data?.admin_guide_page?.map(d=>({stable_id:d.id,slug:d.id,created_at:d.created_at,last_modified_at:d.last_modified_at,title:d.page_title,details:d.details}))??[]);return i.length?i[0]:null}function Ue(n,e){if(!n.length||!e.include_stub&&!e.query&&!e.limit&&!e.offset)return n;let i=e.query?.toLowerCase(),r=n.filter(d=>!e.include_stub&&d.stub?!1:!!(!i||d.title.toLowerCase().includes(i)||d.definition&&d.definition.toLowerCase().includes(i)||d.aliases?.length&&d.aliases.some(a=>a.toLowerCase().includes(i))));return e.offset&&r.length&&(r=r.slice(e.offset)),e.limit&&e.limit<r.length&&(r=r.slice(0,e.limit)),r}import{ApolloClient as Ve,ApolloLink as Me,HttpLink as Fe,InMemoryCache as Ie}from"@apollo/client";import{SetContextLink as qe}from"@apollo/client/link/context";import{GraphQLWsLink as De}from"@apollo/client/link/subscriptions";import{OperationTypeNode as we}from"graphql";import{createClient as Re}from"graphql-ws";var ce=n=>{let e=new Fe({uri:n.url,fetch:n.fetch,headers:typeof n.headers=="object"?n.headers:void 0}),i=async _=>{let t=typeof n.headers=="object"?n.headers:await n.headers();return{headers:{..._,...t}}},r=Re({url:n.url,connectionParams:()=>i(),lazy:!0}),d=new De(r),a=Me.split(({operationType:_})=>_===we.SUBSCRIPTION,d,typeof n.headers=="object"?e:new qe(({headers:_})=>i(_)).concat(e));return{client:new Ve({link:a,cache:new Ie}),wsClient:r}};var ye="PromptQL TypeScript SDK";function ui(n,e){if(!e.length)return[];if(!n.length)return e;let i=n[n.length-1];if(!i)return e;let r=BigInt(i.thread_event_id),d=e.length-1;for(;d>=0;d--){let a=e[d];if(BigInt(a?.thread_event_id)<=r)break}return e.slice(d+1)}function si(n){return"UserMessage"in n?n.UserMessage:null}function pi(n){return"UserCancel"in n?n.UserCancel:null}function mi(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)||!("PlanGenerationStarted"in n.AgentMessage.update.OrchestratorUpdate.update)?null:n.AgentMessage.update.OrchestratorUpdate.update.PlanGenerationStarted}function fi(n){let e=E(n);return!e||!("PlanStepGenerated"in e)?null:e.PlanStepGenerated}function ci(n){return"AgentMessage"in n?"content"in n.AgentMessage.update&&"interaction_update"in n.AgentMessage.update.content&&"main_agent"in n.AgentMessage.update.content.interaction_update&&"completed"in n.AgentMessage.update.content.interaction_update.main_agent?{success:!0,message:n.AgentMessage.update.content.interaction_update.main_agent.completed.summary||"",modified_artifacts:[],generated_at:n.AgentMessage.update.timestamp,messageId:n.AgentMessage.message_id}:!("OrchestratorUpdate"in n.AgentMessage.update)||!("GeneratedResponse"in n.AgentMessage.update.OrchestratorUpdate.update)?null:{...n.AgentMessage.update.OrchestratorUpdate.update.GeneratedResponse.response,messageId:n.AgentMessage.message_id}:null}function yi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("ProcessingStarted"in n.AgentMessage.update.MessageProcessingUpdate.update)?null:n.AgentMessage.update.MessageProcessingUpdate.update.ProcessingStarted}function gi(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("AcceptInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.AcceptInteraction}function ki(n){return!("AgentMessage"in n)||!("MessageProcessingUpdate"in n.AgentMessage.update)||!("InteractionDecision"in n.AgentMessage.update.MessageProcessingUpdate.update)||!("DeclineInteraction"in n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision)?null:n.AgentMessage.update.MessageProcessingUpdate.update.InteractionDecision.decision.DeclineInteraction}function h(n){return!("AgentMessage"in n)||!("PlanningDecisionUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.PlanningDecisionUpdate.update}function Bi(n){let e=h(n);return!e||!("Started"in e)?null:e.Started}function xi(n){let e=h(n);return!e||!("Completed"in e)?null:e.Completed}function vi(n){let e=h(n);return!e||!("PlanningRequired"in e)?null:e.PlanningRequired}function hi(n){return!("AgentMessage"in n)||!("StartingOrchestrator"in n.AgentMessage.update)?null:n.AgentMessage.update.StartingOrchestrator}function E(n){return!("AgentMessage"in n)||!("OrchestratorUpdate"in n.AgentMessage.update)?null:n.AgentMessage.update.OrchestratorUpdate.update}function u(n){let e=E(n);return!e||!("ContextExplorerUpdate"in e)?null:e.ContextExplorerUpdate.update}function Ei(n){let e=u(n);return!e||!("Started"in e)?null:e.Started}function Oi(n){let e=u(n);return!e||!("Completed"in e)?null:e.Completed}function O(n){let e=u(n);return!e||!("WikiExplorerUpdate"in e)?null:e.WikiExplorerUpdate.update}function Ti(n){let e=O(n);return!e||!("Started"in e)?null:e.Started}function Ai(n){let e=O(n);return!e||!("Completed"in e)?null:e.Completed}function bi(n){let e=O(n);return!e||!("WikiInfoGenerated"in e)?null:e.WikiInfoGenerated}function T(n){let e=u(n);return!e||!("SchemaTasksGenerationUpdate"in e)?null:e.SchemaTasksGenerationUpdate.update}function Si(n){let e=T(n);return!e||!("Started"in e)?null:e.Started}function Pi(n){let e=T(n);return!e||!("Completed"in e)?null:e.Completed}function Ci(n){let e=T(n);return!e||!("TasksGenerated"in e)?null:e.TasksGenerated}function o(n){let e=u(n);return!e||!("SchemaExplorerUpdate"in e)?null:e.SchemaExplorerUpdate.update}function Ni(n){let e=o(n);return!e||!("Started"in e)?null:e.Started}function Ui(n){let e=o(n);return!e||!("Completed"in e)?null:e.Completed}function Vi(n){let e=o(n);return!e||!("CodeExecutionComplete"in e)?null:e.CodeExecutionComplete}function Mi(n){let e=o(n);return!e||!("CodeOutputAnalyzed"in e)?null:e.CodeOutputAnalyzed}function Fi(n){let e=o(n);return!e||!("GeneratedCode"in e)?null:e.GeneratedCode}function Ii(n){let e=o(n);return!e||!("SchemaExplored"in e)?null:e.SchemaExplored}function A(n){let e=E(n);return!e||!("StepUpdate"in e)?null:e.StepUpdate}function qi(n){let e=A(n);return!e||!("Programmer"in e.update)?null:e.update.Programmer}function Di(n){let e=A(n);return!e||!("UiProgrammer"in e.update)?null:e.update.UiProgrammer}function wi(n){let e=A(n);return!e||!("SavedProgramRunner"in e.update)?null:e.update.SavedProgramRunner}function Ri(n){if(!("AgentMessage"in n))return null;if("InteractionFinished"in n.AgentMessage.update){let e=n.AgentMessage.update.InteractionFinished.update;return"Completed"in e?{status:"completed",timestamp:e.Completed.completed_at,warnings:e.Completed.warnings,messageId:n.AgentMessage.message_id}:"Errored"in e?{status:"errored",timestamp:e.Errored.errored_at,messageId:n.AgentMessage.message_id,reason:typeof e.Errored.error=="string"?e.Errored.error:e.Errored.error.User.message}:"UserCancelled"in e?{status:"user_cancelled",timestamp:e.UserCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:"AgentDeclined"in e?{status:"agent_declined",timestamp:e.AgentDeclined.declined_at,reason:e.AgentDeclined.reason,messageId:n.AgentMessage.message_id}:"ServerCancelled"in e?{status:"server_cancelled",timestamp:e.ServerCancelled.cancelled_at,messageId:n.AgentMessage.message_id}:{status:"unknown",messageId:n.AgentMessage.message_id}}if("content"in n.AgentMessage.update&&"interaction_finished"in n.AgentMessage.update.content){let e=n.AgentMessage.update.content.interaction_finished.outcome;return"errored"in e?{status:"errored",messageId:n.AgentMessage.message_id,reason:e.errored.user_facing_message||e.errored.raw_error,timestamp:n.AgentMessage.update.timestamp,warnings:e.errored.raw_error?[{message:e.errored.raw_error}]:[]}:"server_cancelled"in e?{status:"server_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"user_cancelled"in e?{status:"user_cancelled",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp}:"completed"in e?{status:"completed",messageId:n.AgentMessage.message_id,timestamp:n.AgentMessage.update.timestamp,warnings:e.completed.warnings}:{status:"unknown",messageId:n.AgentMessage.message_id}}return null}function ji(n){if(n){if("UserMessage"in n)return n.UserMessage.message_id;if("AgentMessage"in n)return n.AgentMessage.message_id;if("UserTeach"in n)return n.UserTeach.agent_message_id;if("UserCancel"in n)return n.UserCancel.message_id}}function s(n){return{Authorization:`pat ${n}`,"User-Agent":ye}}var ge="https://promptql.ddn.hasura.app",m=class{options;defaultTimezone;client;wsClient;project;constructor(e){if(this.options=e,!e.accessToken)throw new Error("accessToken is required");this.defaultTimezone=e.timezone||Intl.DateTimeFormat().resolvedOptions().timeZone;let i=new URL(this.options.baseUrl||ge);i.pathname="/playground-v2-hge/v1/graphql";let{client:r,wsClient:d}=ce({url:i.toString(),fetch:this.options.fetch,headers:Object.assign(s(this.options.accessToken),this.options.headers)});this.wsClient=d,this.client=r}async getProjectInfo(){if(this.project)return this.project;let e=await X(this.client);if(!e)throw new Error("Project not found");let i=new URL(this.options.baseUrl||ge);return i.hostname.startsWith("promptql.")&&(i.hostname=`${e.projectName}${i.hostname.slice(8)}`),this.project={projectId:e.projectId,projectName:e.projectName,projectHost:i.toString(),promptqlConsoleUrl:e.promptqlConsoleUrl},this.project}close(){if(this.wsClient&&this.wsClient.dispose(),this.client){try{this.client.stop?.()}catch{}try{this.client.clearStore?.()}catch{}this.project=void 0}}};var f=class{api;constructor(e){this.api=e}async listMetadataByThreadId(e){let i=await this.api.getProjectInfo();return J(this.api.client,i.projectId,e)}async download(e,i){let r=await this.api.getProjectInfo();return $(r.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}async getMetadata(e,i){let r=await this.api.getProjectInfo();return H(r.projectHost,e,i,s(this.api.options.accessToken),this.api.options.fetch)}};var c=class{api;constructor(e){this.api=e}info(){return this.api.getProjectInfo()}};var y=class{api;constructor(e){this.api=e}async list(e){return x(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async getByName(e){return x(this.api.client,{where:{name:{_eq:e}},limit:1}).then(i=>i.length?i[0]??null:null)}async create(e){return Y(this.api.client,e)}};var g=class{api;constructor(e){this.api=e}async list(e){return ee(this.api.client,{...e,limit:e.limit&&e.limit>0?e.limit:10})}async get(e){if(!e)throw new Error("threadId is required");return ne(this.api.client,e)}async start(e){let i=await this.api.getProjectInfo();return de(this.api.client,{...e,projectId:i.projectId,buildId:e.buildId||this.api.options.buildId,timezone:e.timezone||this.api.defaultTimezone})}async detail(e,i){return ie(this.api.client,e,i)}async getEvents(e,i){return v(this.api.client,e,i)}async sendMessage(e){return re(this.api.client,{...e,timezone:e.timezone||this.api.defaultTimezone})}async cancelAgentMessage(e){return te(this.api.client,e)}subscribeEvents(e,i){return ae(this.api.client,e,i)}streamMessageEvents(e,i){return _e(this.api.client,e,i)}};var k=class{api;constructor(e){this.api=e}async list(e){return oe(this.api.client,e)}async search(e){return ue(this.api.client,e)}async get(e,i){let r=await this.api.getProjectInfo();return se(this.api.client,r.projectId,e,i)}async create(e){return pe(this.api.client,e)}async update(e,i){return me(this.api.client,e,i)}async delete(e){return fe(this.api.client,e)}};var ke=class{constructor(e){let i=new m(e);this.api=i,this.thread=new g(i),this.project=new c(i),this.room=new y(i),this.artifact=new f(i),this.wiki=new k(i)}api;thread;project;room;artifact;wiki;close(){this.api.close()}};export{ke as PromptQLSdk,xe as ROOM_NAME_REGEX,ye as USER_AGENT,s as buildAuthHeader,te as cancelAgentMessage,ce as createApolloClient,Y as createRoom,pe as createWikiPage,fe as deleteWikiPage,ui as diffThreadEvents,$ as downloadArtifactData,ci as getAgentGeneratedResponse,gi as getAgentInteractionDecisionAcceptInteractionEvent,ki as getAgentInteractionDecisionDeclineInteractionEvent,Ri as getAgentInteractionFinishedEvent,yi as getAgentMessageProcessingStartedEvent,Oi as getAgentOrchestratorContextExplorerCompletedEvent,Ei as getAgentOrchestratorContextExplorerStartedEvent,u as getAgentOrchestratorContextExplorerUpdateEvent,Vi as getAgentOrchestratorSchemaExplorerCodeExecutionCompleteEvent,Mi as getAgentOrchestratorSchemaExplorerCodeOutputAnalyzedEvent,Ui as getAgentOrchestratorSchemaExplorerCompletedEvent,Fi as getAgentOrchestratorSchemaExplorerGeneratedCodeEvent,Ii as getAgentOrchestratorSchemaExplorerSchemaExploredEvent,Ni as getAgentOrchestratorSchemaExplorerStartedEvent,o as getAgentOrchestratorSchemaExplorerUpdateEvent,Ci as getAgentOrchestratorSchemaTasksGeneratedEvent,Pi as getAgentOrchestratorSchemaTasksGenerationCompletedEvent,Si as getAgentOrchestratorSchemaTasksGenerationStartedEvent,T as getAgentOrchestratorSchemaTasksGenerationUpdateEvent,qi as getAgentOrchestratorStepProgrammerEvent,wi as getAgentOrchestratorStepSavedProgramRunnerEvent,Di as getAgentOrchestratorStepUiProgrammerEvent,A as getAgentOrchestratorStepUpdateEvent,E as getAgentOrchestratorUpdateEvent,Ai as getAgentOrchestratorWikiExplorerCompletedEvent,Ti as getAgentOrchestratorWikiExplorerStartedEvent,O as getAgentOrchestratorWikiExplorerUpdateEvent,bi as getAgentOrchestratorWikiInfoGeneratedEvent,mi as getAgentPlanGenerationStartedEvent,fi as getAgentPlanStepGeneratedEvent,xi as getAgentPlanningDecisionCompletedEvent,vi as getAgentPlanningDecisionPlanningRequiredEvent,Bi as getAgentPlanningDecisionStartedEvent,h as getAgentPlanningDecisionUpdateEvent,hi as getAgentStartingOrchestratorEvent,H as getArtifactMetadata,X as getProjectInfo,ne as getThread,ie as getThreadAndEvents,ji as getThreadEventMessageId,v as getThreadEvents,pi as getUserCancelEvent,si as getUserMessageEvent,se as getWikiPage,Ae as isInteractionAnalyzing,J as listArtifactMetadataByThreadId,x as listRooms,ee as listThreads,oe as listWikiPages,ue as searchWikiPages,re as sendThreadMessage,de as startThread,_e as streamThreadMessageEvents,ae as subscribeThreadEvents,me as updateWikiPage,ve as validateRoomName};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@hasura/promptql",
|
|
3
3
|
"description": "A Typescript SDK allows you to interact with PromptQL API",
|
|
4
|
-
"version": "2.0.0-alpha.
|
|
4
|
+
"version": "2.0.0-alpha.40",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Hasura",
|
|
7
7
|
"homepage": "https://promptql.hasura.io",
|
|
@@ -20,9 +20,13 @@
|
|
|
20
20
|
"main": "./dist/index.js",
|
|
21
21
|
"module": "./dist/index.mjs",
|
|
22
22
|
"types": "./dist/index.d.ts",
|
|
23
|
+
"exports": {
|
|
24
|
+
".": "./dist/index.js",
|
|
25
|
+
"./auth": "./dist/auth/index.js"
|
|
26
|
+
},
|
|
23
27
|
"scripts": {
|
|
24
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
25
|
-
"build": "tsup src/index.ts --minify --clean --format cjs,esm --dts",
|
|
28
|
+
"dev": "tsup src/index.ts src/auth/index.ts --format cjs,esm --dts --watch",
|
|
29
|
+
"build": "tsup src/index.ts src/auth/index.ts --minify --clean --format cjs,esm --dts",
|
|
26
30
|
"test": "bun test",
|
|
27
31
|
"lint": "biome check .",
|
|
28
32
|
"format": "biome check . --write",
|
|
@@ -30,15 +34,15 @@
|
|
|
30
34
|
},
|
|
31
35
|
"devDependencies": {
|
|
32
36
|
"@types/bun": "latest",
|
|
33
|
-
"@types/node": "^25.
|
|
37
|
+
"@types/node": "^25.6.0",
|
|
34
38
|
"tsup": "^8.5.1",
|
|
35
|
-
"typescript": "
|
|
39
|
+
"typescript": "6.0.3"
|
|
36
40
|
},
|
|
37
41
|
"dependencies": {
|
|
38
|
-
"@apollo/client": "^4.
|
|
42
|
+
"@apollo/client": "^4.2.0",
|
|
39
43
|
"@graphql-typed-document-node/core": "^3.2.0",
|
|
40
|
-
"graphql": "^16.
|
|
41
|
-
"graphql-ws": "^6.0.
|
|
44
|
+
"graphql": "^16.14.0",
|
|
45
|
+
"graphql-ws": "^6.0.8",
|
|
42
46
|
"rxjs": "^7.8.2"
|
|
43
47
|
}
|
|
44
48
|
}
|
package/tsconfig.json
CHANGED
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
"incremental": false,
|
|
8
8
|
"isolatedModules": true,
|
|
9
9
|
"lib": [
|
|
10
|
-
"
|
|
10
|
+
"ES2022",
|
|
11
|
+
"DOM"
|
|
11
12
|
],
|
|
12
13
|
"module": "NodeNext",
|
|
13
14
|
"moduleDetection": "force",
|
|
@@ -17,7 +18,9 @@
|
|
|
17
18
|
"skipLibCheck": true,
|
|
18
19
|
"strict": true,
|
|
19
20
|
"target": "ES2022",
|
|
20
|
-
"
|
|
21
|
+
"rootDir": "src",
|
|
22
|
+
"outDir": "dist",
|
|
23
|
+
"ignoreDeprecations": "6.0"
|
|
21
24
|
},
|
|
22
25
|
"include": [
|
|
23
26
|
"src"
|