-- Generated by scripts/generate.mjs. Do not edit. module Dagger.Query ( address , blob , blobWith , BlobOpts , defaultBlobOpts , cacheVolume , cacheVolumeWith , CacheVolumeOpts , defaultCacheVolumeOpts , changeset , cloud , container , containerWith , ContainerOpts , defaultContainerOpts , currentFunctionCall , currentModule , currentNode , currentTimestamp , currentTypeDefs , currentTypeDefsWith , CurrentTypeDefsOpts , defaultCurrentTypeDefsOpts , currentWorkspace , defaultPlatform , directory , engine , engineVolume , engineVolumeWith , EngineVolumeOpts , defaultEngineVolumeOpts , envFile , envFileWith , EnvFileOpts , defaultEnvFileOpts , error , file , fileWith , FileOpts , defaultFileOpts , formatIdentifiers , formatIdentifiersWith , FormatIdentifiersOpts , defaultFormatIdentifiersOpts , function , generatedCode , git , gitWith , GitOpts , defaultGitOpts , host , http , httpWith , HttpOpts , defaultHttpOpts , id , identifier , json , llm , llmWith , LlmOpts , defaultLlmOpts , llmContent , module_ , moduleSource , moduleSourceWith , ModuleSourceOpts , defaultModuleSourceOpts , namingDictionary , node , schema , secret , secretWith , SecretOpts , defaultSecretOpts , serveModule , serveModuleWith , ServeModuleOpts , defaultServeModuleOpts , setSecret , setSessionTitle , sourceMap , sshfsVolume , sshfsVolumeWith , SshfsVolumeOpts , defaultSshfsVolumeOpts , typeDef , version ) where import Data.Maybe (Maybe(..)) import Effect.Aff (Aff) import Dagger.Internal.Runtime as R import Dagger.Types as T -- | Resolve external references only. address :: String -> T.Query -> T.Address address argValue = R.select "address" [R.argument "value" "String!" argValue] type BlobOpts = { permissions :: Maybe Int } defaultBlobOpts :: BlobOpts defaultBlobOpts = { permissions: Nothing } -- | Creates a file from arbitrary binary contents. blob :: String -> T.Bytes -> T.Query -> T.File blob argName argContents = blobWith argName argContents defaultBlobOpts -- | Creates a file from arbitrary binary contents. blobWith :: String -> T.Bytes -> BlobOpts -> T.Query -> T.File blobWith argName argContents opts = R.select "blob" [R.argument "name" "String!" argName, R.argument "contents" "Bytes!" argContents, R.optional (R.argument "permissions" "Int") opts.permissions] type CacheVolumeOpts = { source :: Maybe T.Directory , sharing :: Maybe T.CacheSharingMode , owner :: Maybe String } defaultCacheVolumeOpts :: CacheVolumeOpts defaultCacheVolumeOpts = { source: Nothing , sharing: Nothing , owner: Nothing } -- | Constructs a cache volume for a given cache key. cacheVolume :: String -> T.Query -> T.CacheVolume cacheVolume argKey = cacheVolumeWith argKey defaultCacheVolumeOpts -- | Constructs a cache volume for a given cache key. cacheVolumeWith :: String -> CacheVolumeOpts -> T.Query -> T.CacheVolume cacheVolumeWith argKey opts = R.select "cacheVolume" [R.argument "key" "String!" argKey, R.optional (R.objectArgument "source" "ID") opts.source, R.optional (R.argument "sharing" "CacheSharingMode") opts.sharing, R.optional (R.argument "owner" "String") opts.owner] -- | Creates an empty changeset changeset :: T.Query -> T.Changeset changeset = R.select "changeset" [] -- | Dagger Cloud configuration and state cloud :: T.Query -> T.Cloud cloud = R.select "cloud" [] type ContainerOpts = { platform :: Maybe T.Platform } defaultContainerOpts :: ContainerOpts defaultContainerOpts = { platform: Nothing } -- | Creates a scratch container, with no image or metadata. -- | -- | To pull an image, follow up with the "from" function. container :: T.Query -> T.Container container = containerWith defaultContainerOpts -- | Creates a scratch container, with no image or metadata. -- | -- | To pull an image, follow up with the "from" function. containerWith :: ContainerOpts -> T.Query -> T.Container containerWith opts = R.select "container" [R.optional (R.argument "platform" "Platform") opts.platform] -- | The FunctionCall context that the SDK caller is currently executing in. -- | -- | If the caller is not currently executing in a function, this will return an error. currentFunctionCall :: T.Query -> T.FunctionCall currentFunctionCall = R.select "currentFunctionCall" [] -- | The module currently being served in the session, if any. currentModule :: T.Query -> T.CurrentModule currentModule = R.select "currentModule" [] -- | The object that received the current module function call, as a Node. Errors when there is no current call, or the call is top-level (e.g. a module constructor). currentNode :: T.Query -> T.Node currentNode = R.select "currentNode" [] -- | The current UTC time in RFC3339 format. Never cached. currentTimestamp :: T.Query -> Aff String currentTimestamp = R.scalar "currentTimestamp" [] type CurrentTypeDefsOpts = { returnAllTypes :: Maybe Boolean , hideCore :: Maybe Boolean } defaultCurrentTypeDefsOpts :: CurrentTypeDefsOpts defaultCurrentTypeDefsOpts = { returnAllTypes: Nothing , hideCore: Nothing } -- | The TypeDef representations of the objects currently being served in the session. currentTypeDefs :: T.Query -> Aff (Array T.TypeDef) currentTypeDefs = currentTypeDefsWith defaultCurrentTypeDefsOpts -- | The TypeDef representations of the objects currently being served in the session. currentTypeDefsWith :: CurrentTypeDefsOpts -> T.Query -> Aff (Array T.TypeDef) currentTypeDefsWith opts = R.objectList "TypeDef" "currentTypeDefs" [R.optional (R.argument "returnAllTypes" "Boolean") opts.returnAllTypes, R.optional (R.argument "hideCore" "Boolean") opts.hideCore] -- | Detect and return the current workspace. currentWorkspace :: T.Query -> T.Workspace currentWorkspace = R.select "currentWorkspace" [] -- | The default platform of the engine. defaultPlatform :: T.Query -> Aff T.Platform defaultPlatform = R.scalar "defaultPlatform" [] -- | Creates an empty directory. directory :: T.Query -> T.Directory directory = R.select "directory" [] -- | The Dagger engine container configuration and state engine :: T.Query -> T.Engine engine = R.select "engine" [] type EngineVolumeOpts = { subdir :: Maybe String } defaultEngineVolumeOpts :: EngineVolumeOpts defaultEngineVolumeOpts = { subdir: Nothing } -- | Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root. engineVolume :: String -> T.Query -> T.Volume engineVolume argName = engineVolumeWith argName defaultEngineVolumeOpts -- | Constructs an engine-managed volume backed by operator-provided storage beneath the configured engine state root. engineVolumeWith :: String -> EngineVolumeOpts -> T.Query -> T.Volume engineVolumeWith argName opts = R.select "engineVolume" [R.argument "name" "String!" argName, R.optional (R.argument "subdir" "String") opts.subdir] type EnvFileOpts = { expand :: Maybe Boolean } defaultEnvFileOpts :: EnvFileOpts defaultEnvFileOpts = { expand: Nothing } -- | Initialize an environment file envFile :: T.Query -> T.EnvFile envFile = envFileWith defaultEnvFileOpts -- | Initialize an environment file envFileWith :: EnvFileOpts -> T.Query -> T.EnvFile envFileWith opts = R.select "envFile" [R.optional (R.argument "expand" "Boolean") opts.expand] -- | Create a new error. error :: String -> T.Query -> T.Error error argMessage = R.select "error" [R.argument "message" "String!" argMessage] type FileOpts = { permissions :: Maybe Int } defaultFileOpts :: FileOpts defaultFileOpts = { permissions: Nothing } -- | Creates a file with the specified contents. file :: String -> String -> T.Query -> T.File file argName argContents = fileWith argName argContents defaultFileOpts -- | Creates a file with the specified contents. fileWith :: String -> String -> FileOpts -> T.Query -> T.File fileWith argName argContents opts = R.select "file" [R.argument "name" "String!" argName, R.argument "contents" "String!" argContents, R.optional (R.argument "permissions" "Int") opts.permissions] type FormatIdentifiersOpts = { acronyms :: Maybe T.AcronymStyle , version :: Maybe String } defaultFormatIdentifiersOpts :: FormatIdentifiersOpts defaultFormatIdentifiersOpts = { acronyms: Nothing , version: Nothing } -- | Format many names at once, for codegen. Returns them in input order. formatIdentifiers :: (Array String) -> T.Casing -> T.Query -> Aff (Array String) formatIdentifiers argNames argCasing = formatIdentifiersWith argNames argCasing defaultFormatIdentifiersOpts -- | Format many names at once, for codegen. Returns them in input order. formatIdentifiersWith :: (Array String) -> T.Casing -> FormatIdentifiersOpts -> T.Query -> Aff (Array String) formatIdentifiersWith argNames argCasing opts = R.scalar "formatIdentifiers" [R.argument "names" "[String!]!" argNames, R.argument "casing" "Casing!" argCasing, R.optional (R.argument "acronyms" "AcronymStyle") opts.acronyms, R.optional (R.argument "version" "String") opts.version] -- | Creates a function. function :: String -> T.TypeDef -> T.Query -> T.Function function argName argReturnType = R.select "function" [R.argument "name" "String!" argName, R.objectArgument "returnType" "ID!" argReturnType] -- | Create a code generation result, given a directory containing the generated code. generatedCode :: T.Directory -> T.Query -> T.GeneratedCode generatedCode argCode = R.select "generatedCode" [R.objectArgument "code" "ID!" argCode] type GitOpts = { keepGitDir :: Maybe Boolean , sshKnownHosts :: Maybe String , sshAuthSocket :: Maybe T.Socket , httpAuthUsername :: Maybe String , httpAuthToken :: Maybe T.Secret , httpAuthHeader :: Maybe T.Secret , experimentalServiceHost :: Maybe T.Service } defaultGitOpts :: GitOpts defaultGitOpts = { keepGitDir: Nothing , sshKnownHosts: Nothing , sshAuthSocket: Nothing , httpAuthUsername: Nothing , httpAuthToken: Nothing , httpAuthHeader: Nothing , experimentalServiceHost: Nothing } -- | Queries a Git repository. git :: String -> T.Query -> T.GitRepository git argUrl = gitWith argUrl defaultGitOpts -- | Queries a Git repository. gitWith :: String -> GitOpts -> T.Query -> T.GitRepository gitWith argUrl opts = R.select "git" [R.argument "url" "String!" argUrl, R.optional (R.argument "keepGitDir" "Boolean") opts.keepGitDir, R.optional (R.argument "sshKnownHosts" "String") opts.sshKnownHosts, R.optional (R.objectArgument "sshAuthSocket" "ID") opts.sshAuthSocket, R.optional (R.argument "httpAuthUsername" "String") opts.httpAuthUsername, R.optional (R.objectArgument "httpAuthToken" "ID") opts.httpAuthToken, R.optional (R.objectArgument "httpAuthHeader" "ID") opts.httpAuthHeader, R.optional (R.objectArgument "experimentalServiceHost" "ID") opts.experimentalServiceHost] -- | Queries the host environment. host :: T.Query -> T.Host host = R.select "host" [] type HttpOpts = { name :: Maybe String , permissions :: Maybe Int , checksum :: Maybe String , authHeader :: Maybe T.Secret , experimentalServiceHost :: Maybe T.Service } defaultHttpOpts :: HttpOpts defaultHttpOpts = { name: Nothing , permissions: Nothing , checksum: Nothing , authHeader: Nothing , experimentalServiceHost: Nothing } -- | Returns a file containing an http remote url content. http :: String -> T.Query -> T.File http argUrl = httpWith argUrl defaultHttpOpts -- | Returns a file containing an http remote url content. httpWith :: String -> HttpOpts -> T.Query -> T.File httpWith argUrl opts = R.select "http" [R.argument "url" "String!" argUrl, R.optional (R.argument "name" "String") opts.name, R.optional (R.argument "permissions" "Int") opts.permissions, R.optional (R.argument "checksum" "String") opts.checksum, R.optional (R.objectArgument "authHeader" "ID") opts.authHeader, R.optional (R.objectArgument "experimentalServiceHost" "ID") opts.experimentalServiceHost] -- | A unique identifier for this Query. id :: T.Query -> Aff T.ID id = R.scalar "id" [] -- | Parse a name in any casing into words. -- | -- | Known acronyms and terms come from the naming dictionary; everything else falls back to the case heuristic. Errors on non-ASCII input, input with no letters or digits, or input over 256 bytes. identifier :: String -> T.Query -> T.Identifier identifier argName = R.select "identifier" [R.argument "name" "String!" argName] -- | Initialize a JSON value json :: T.Query -> T.JSONValue json = R.select "json" [] type LlmOpts = { model :: Maybe String , provider :: Maybe String } defaultLlmOpts :: LlmOpts defaultLlmOpts = { model: Nothing , provider: Nothing } -- | Initialize a new LLM conversation. llm :: T.Query -> T.LLM llm = llmWith defaultLlmOpts -- | Initialize a new LLM conversation. llmWith :: LlmOpts -> T.Query -> T.LLM llmWith opts = R.select "llm" [R.optional (R.argument "model" "String") opts.model, R.optional (R.argument "provider" "String") opts.provider] -- | Start an empty run of text and media content, independent of any conversation. -- | -- | Add blocks with withText, withFile, and withData. A function exposed as an LLM tool can return the content to give the model text and media as the tool's result, e.g. a caption and a screenshot for the model to look at. llmContent :: T.Query -> T.LLMContent llmContent = R.select "llmContent" [] -- | Create a new module. module_ :: T.Query -> T.Module module_ = R.select "module" [] type ModuleSourceOpts = { version :: Maybe String , refPin :: Maybe String , disableFindUp :: Maybe Boolean , allowNotExists :: Maybe Boolean , requireKind :: Maybe T.ModuleSourceKind } defaultModuleSourceOpts :: ModuleSourceOpts defaultModuleSourceOpts = { version: Nothing , refPin: Nothing , disableFindUp: Nothing , allowNotExists: Nothing , requireKind: Nothing } -- | Create a new module source instance from a source ref string moduleSource :: String -> T.Query -> T.ModuleSource moduleSource argRefString = moduleSourceWith argRefString defaultModuleSourceOpts -- | Create a new module source instance from a source ref string moduleSourceWith :: String -> ModuleSourceOpts -> T.Query -> T.ModuleSource moduleSourceWith argRefString opts = R.select "moduleSource" [R.argument "refString" "String!" argRefString, R.optional (R.argument "version" "String") opts.version, R.optional (R.argument "refPin" "String") opts.refPin, R.optional (R.argument "disableFindUp" "Boolean") opts.disableFindUp, R.optional (R.argument "allowNotExists" "Boolean") opts.allowNotExists, R.optional (R.argument "requireKind" "ModuleSourceKind") opts.requireKind] -- | The acronyms and terms used to parse and format identifiers. namingDictionary :: T.Query -> Aff (Array T.NamingTerm) namingDictionary = R.objectList "NamingTerm" "namingDictionary" [] -- | Load any object by its ID. node :: T.ID -> T.Query -> Aff (Maybe T.Node) node argId = R.nullableObject "Node" "node" [R.argument "id" "ID!" argId] -- | Load a GraphQL introspection schema for merging. schema :: T.JSON -> T.Query -> T.Schema schema argJson = R.select "schema" [R.argument "json" "JSON!" argJson] type SecretOpts = { cacheKey :: Maybe String } defaultSecretOpts :: SecretOpts defaultSecretOpts = { cacheKey: Nothing } -- | Creates a new secret. secret :: String -> T.Query -> T.Secret secret argUri = secretWith argUri defaultSecretOpts -- | Creates a new secret. secretWith :: String -> SecretOpts -> T.Query -> T.Secret secretWith argUri opts = R.select "secret" [R.argument "uri" "String!" argUri, R.optional (R.argument "cacheKey" "String") opts.cacheKey] type ServeModuleOpts = { refPin :: Maybe String } defaultServeModuleOpts :: ServeModuleOpts defaultServeModuleOpts = { refPin: Nothing } -- | Load the module at the given address and serve its API in the current session. -- | -- | A local address resolves against the caller's workspace, so a generated client can serve the module it is bound to without reaching for the workspace itself. serveModule :: String -> T.Query -> Aff (Maybe T.Void) serveModule argAddress = serveModuleWith argAddress defaultServeModuleOpts -- | Load the module at the given address and serve its API in the current session. -- | -- | A local address resolves against the caller's workspace, so a generated client can serve the module it is bound to without reaching for the workspace itself. serveModuleWith :: String -> ServeModuleOpts -> T.Query -> Aff (Maybe T.Void) serveModuleWith argAddress opts = R.scalar "serveModule" [R.argument "address" "String!" argAddress, R.optional (R.argument "refPin" "String") opts.refPin] -- | Sets a secret given a user defined name to its plaintext and returns the secret. -- | -- | The plaintext value is limited to a size of 128000 bytes. setSecret :: String -> String -> T.Query -> T.Secret setSecret argName argPlaintext = R.select "setSecret" [R.argument "name" "String!" argName, R.argument "plaintext" "String!" argPlaintext] -- | Name the current session. -- | -- | The title renames the session wherever its telemetry is shown (the calling client's primary span, e.g. the CLI's command span) and labels its engine archive, as listed by dagger agent --resume. The latest title wins. Only the session's main client may set it. setSessionTitle :: String -> T.Query -> Aff (Maybe T.Void) setSessionTitle argTitle = R.scalar "setSessionTitle" [R.argument "title" "String!" argTitle] -- | Creates source map metadata. sourceMap :: String -> Int -> Int -> T.Query -> T.SourceMap sourceMap argFilename argLine argColumn = R.select "sourceMap" [R.argument "filename" "String!" argFilename, R.argument "line" "Int!" argLine, R.argument "column" "Int!" argColumn] type SshfsVolumeOpts = { knownHosts :: Maybe T.Secret , cacheKey :: Maybe String , insecureSkipHostKeyCheck :: Maybe Boolean , experimentalServiceHost :: Maybe T.Service } defaultSshfsVolumeOpts :: SshfsVolumeOpts defaultSshfsVolumeOpts = { knownHosts: Nothing , cacheKey: Nothing , insecureSkipHostKeyCheck: Nothing , experimentalServiceHost: Nothing } -- | Constructs an SSHFS volume. sshfsVolume :: String -> T.Secret -> T.Query -> T.Volume sshfsVolume argEndpoint argPrivateKey = sshfsVolumeWith argEndpoint argPrivateKey defaultSshfsVolumeOpts -- | Constructs an SSHFS volume. sshfsVolumeWith :: String -> T.Secret -> SshfsVolumeOpts -> T.Query -> T.Volume sshfsVolumeWith argEndpoint argPrivateKey opts = R.select "sshfsVolume" [R.argument "endpoint" "String!" argEndpoint, R.objectArgument "privateKey" "ID!" argPrivateKey, R.optional (R.objectArgument "knownHosts" "ID") opts.knownHosts, R.optional (R.argument "cacheKey" "String") opts.cacheKey, R.optional (R.argument "insecureSkipHostKeyCheck" "Boolean") opts.insecureSkipHostKeyCheck, R.optional (R.objectArgument "experimentalServiceHost" "ID") opts.experimentalServiceHost] -- | Create a new TypeDef. typeDef :: T.Query -> T.TypeDef typeDef = R.select "typeDef" [] -- | Get the current Dagger Engine version. version :: T.Query -> Aff String version = R.scalar "version" []