Client
class Client extends AbstractClient implements IdAble, Node
The root of the DAG.
Properties
| protected AbstractClient | $client | from AbstractClient | |
| protected Client | $graphQlClient | from AbstractClient |
Methods
No description
No description
Load an object by its ID using node(id:) with an inline fragment.
initialize an address to load directories, containers, secrets or other object types.
Constructs a cache volume for a given cache key.
Creates a scratch container, with no image or metadata.
Returns the current environment
The FunctionCall context that the SDK caller is currently executing in.
The module currently being served in the session, if any.
The TypeDef representations of the objects currently being served in the session.
Detect and return the current workspace.
The default platform of the engine.
Creates a file with the specified contents.
Create a code generation result, given a directory containing the generated code.
Queries a Git repository.
Returns a file containing an http remote url content.
Initialize a Large Language Model (LLM)
Create a new module source instance from a source ref string
Sets a secret given a user defined name to its plaintext and returns the secret.
Get the current Dagger Engine version.
Details
in
AbstractClient at line 22
__construct(Client $clientOrConnection, QueryBuilderChain $queryBuilderChain = new QueryBuilderChain())
No description
in
AbstractClient at line 35
Results
runQuery(Query $query)
No description
in
AbstractClient at line 40
null|array|string|int|float|bool
queryLeaf(Query $query, string $leafKey)
No description
in
AbstractClient at line 66
object
loadObjectFromId(string $className, Id $id)
Load an object by its ID using node(id:) with an inline fragment.
at line 19
Address
address(string $value)
initialize an address to load directories, containers, secrets or other object types.
at line 29
CacheVolume
cacheVolume(string $key, Directory|null $source = null, CacheSharingMode|null $sharing = null, string|null $owner = '')
Constructs a cache volume for a given cache key.
at line 52
Changeset
changeset()
Creates an empty changeset
at line 61
Cloud
cloud()
Dagger Cloud configuration and state
at line 67
GeneratedCode
codegen(ModuleSource $modSource, File $introspectionJson)
No description
at line 75
Container
codegenBase(ModuleSource $modSource, File $introspectionJson)
No description
at line 88
Container
container(Platform|null $platform = null)
Creates a scratch container, with no image or metadata.
To pull an image, follow up with the "from" function.
at line 104
Env
currentEnv()
Returns the current environment
When called from a function invoked via an LLM tool call, this will be the LLM's current environment, including any modifications made through calling tools. Env values returned by functions become the new environment for subsequent calls, and Changeset values returned by functions are applied to the environment's workspace.
When called from a module function outside of an LLM, this returns an Env with the current module installed, and with the current module's source directory as its workspace.
at line 115
FunctionCall
currentFunctionCall()
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.
at line 124
CurrentModule
currentModule()
The module currently being served in the session, if any.
at line 133
array
currentTypeDefs(bool|null $returnAllTypes = false, bool|null $hideCore = null)
The TypeDef representations of the objects currently being served in the session.
at line 148
Workspace
currentWorkspace()
Detect and return the current workspace.
at line 157
Platform
defaultPlatform()
The default platform of the engine.
at line 166
Directory
directory()
Creates an empty directory.
at line 175
Engine
engine()
The Dagger engine container configuration and state
at line 184
Env
env(bool|null $privileged = false, bool|null $writable = false)
Initializes a new environment
at line 199
EnvFile
envFile(bool|null $expand = null)
Initialize an environment file
at line 211
Error
error(string $message)
Create a new error.
at line 221
File
file(string $name, string $contents, int|null $permissions = 420)
Creates a file with the specified contents.
at line 246
GeneratedCode
generatedCode(Directory $code)
Create a code generation result, given a directory containing the generated code.
at line 256
GitRepository
git(string $url, bool|null $keepGitDir = true, string|null $sshKnownHosts = '', Socket|null $sshAuthSocket = null, string|null $httpAuthUsername = '', Secret|null $httpAuthToken = null, Secret|null $httpAuthHeader = null, Service|null $experimentalServiceHost = null)
Queries a Git repository.
at line 295
Host
host()
Queries the host environment.
at line 304
File
http(string $url, string|null $name = null, int|null $permissions = null, string|null $checksum = null, Secret|null $authHeader = null, Service|null $experimentalServiceHost = null)
Returns a file containing an http remote url content.
at line 335
Id
id()
A unique identifier for this Query.
at line 344
JsonValue
json()
Initialize a JSON value
at line 353
LLM
llm(string|null $model = null, int|null $maxAPICalls = null)
Initialize a Large Language Model (LLM)
at line 388
CacheVolume
loadCacheVolumeFromID(CacheVolumeId $id)
Load a CacheVolume from its ID.
at line 398
Changeset
loadChangesetFromID(ChangesetId $id)
Load a Changeset from its ID.
at line 418
CheckGroup
loadCheckGroupFromID(CheckGroupId $id)
Load a CheckGroup from its ID.
at line 428
ClientFilesyncMirror
loadClientFilesyncMirrorFromID(ClientFilesyncMirrorId $id)
Load a ClientFilesyncMirror from its ID.
at line 448
Container
loadContainerFromID(ContainerId $id)
Load a Container from its ID.
at line 458
CurrentModule
loadCurrentModuleFromID(CurrentModuleId $id)
Load a CurrentModule from its ID.
at line 468
DiffStat
loadDiffStatFromID(DiffStatId $id)
Load a DiffStat from its ID.
at line 478
Directory
loadDirectoryFromID(DirectoryId $id)
Load a Directory from its ID.
at line 488
EngineCacheEntry
loadEngineCacheEntryFromID(EngineCacheEntryId $id)
Load a EngineCacheEntry from its ID.
at line 498
EngineCacheEntrySet
loadEngineCacheEntrySetFromID(EngineCacheEntrySetId $id)
Load a EngineCacheEntrySet from its ID.
at line 508
EngineCache
loadEngineCacheFromID(EngineCacheId $id)
Load a EngineCache from its ID.
at line 528
EnumTypeDef
loadEnumTypeDefFromID(EnumTypeDefId $id)
Load a EnumTypeDef from its ID.
at line 538
EnumValueTypeDef
loadEnumValueTypeDefFromID(EnumValueTypeDefId $id)
Load a EnumValueTypeDef from its ID.
at line 568
EnvVariable
loadEnvVariableFromID(EnvVariableId $id)
Load a EnvVariable from its ID.
at line 588
ErrorValue
loadErrorValueFromID(ErrorValueId $id)
Load a ErrorValue from its ID.
at line 598
Exportable
loadExportableFromID(ExportableId $id)
Load a Exportable from its ID.
at line 608
FieldTypeDef
loadFieldTypeDefFromID(FieldTypeDefId $id)
Load a FieldTypeDef from its ID.
at line 628
FunctionArg
loadFunctionArgFromID(FunctionArgId $id)
Load a FunctionArg from its ID.
at line 638
FunctionCallArgValue
loadFunctionCallArgValueFromID(FunctionCallArgValueId $id)
Load a FunctionCallArgValue from its ID.
at line 648
FunctionCall
loadFunctionCallFromID(FunctionCallId $id)
Load a FunctionCall from its ID.
at line 658
Function_
loadFunctionFromID(FunctionId $id)
Load a Function from its ID.
at line 668
GeneratedCode
loadGeneratedCodeFromID(GeneratedCodeId $id)
Load a GeneratedCode from its ID.
at line 678
Generator
loadGeneratorFromID(GeneratorId $id)
Load a Generator from its ID.
at line 688
GeneratorGroup
loadGeneratorGroupFromID(GeneratorGroupId $id)
Load a GeneratorGroup from its ID.
at line 708
GitRepository
loadGitRepositoryFromID(GitRepositoryId $id)
Load a GitRepository from its ID.
at line 718
HTTPState
loadHTTPStateFromID(HTTPStateId $id)
Load a HTTPState from its ID.
at line 728
HealthcheckConfig
loadHealthcheckConfigFromID(HealthcheckConfigId $id)
Load a HealthcheckConfig from its ID.
at line 748
InputTypeDef
loadInputTypeDefFromID(InputTypeDefId $id)
Load a InputTypeDef from its ID.
at line 758
InterfaceTypeDef
loadInterfaceTypeDefFromID(InterfaceTypeDefId $id)
Load a InterfaceTypeDef from its ID.
at line 768
JsonValue
loadJSONValueFromID(JsonValueId $id)
Load a JSONValue from its ID.
at line 788
LLMTokenUsage
loadLLMTokenUsageFromID(LLMTokenUsageId $id)
Load a LLMTokenUsage from its ID.
at line 808
ListTypeDef
loadListTypeDefFromID(ListTypeDefId $id)
Load a ListTypeDef from its ID.
at line 818
ModuleConfigClient
loadModuleConfigClientFromID(ModuleConfigClientId $id)
Load a ModuleConfigClient from its ID.
at line 838
ModuleSource
loadModuleSourceFromID(ModuleSourceId $id)
Load a ModuleSource from its ID.
at line 848
ObjectTypeDef
loadObjectTypeDefFromID(ObjectTypeDefId $id)
Load a ObjectTypeDef from its ID.
at line 878
RemoteGitMirror
loadRemoteGitMirrorFromID(RemoteGitMirrorId $id)
Load a RemoteGitMirror from its ID.
at line 888
SDKConfig
loadSDKConfigFromID(SDKConfigId $id)
Load a SDKConfig from its ID.
at line 898
ScalarTypeDef
loadScalarTypeDefFromID(ScalarTypeDefId $id)
Load a ScalarTypeDef from its ID.
at line 908
SearchResult
loadSearchResultFromID(SearchResultId $id)
Load a SearchResult from its ID.
at line 918
SearchSubmatch
loadSearchSubmatchFromID(SearchSubmatchId $id)
Load a SearchSubmatch from its ID.
at line 958
SourceMap
loadSourceMapFromID(SourceMapId $id)
Load a SourceMap from its ID.
at line 988
Terminal
loadTerminalFromID(TerminalId $id)
Load a Terminal from its ID.
at line 1028
Workspace
loadWorkspaceFromID(WorkspaceId $id)
Load a Workspace from its ID.
at line 1038
Module
module()
Create a new module.
at line 1044
Container
moduleRuntime(ModuleSource $modSource, File $introspectionJson)
No description
at line 1055
ModuleSource
moduleSource(string $refString, string|null $refPin = '', bool|null $disableFindUp = false, bool|null $allowNotExists = false, ModuleSourceKind|null $requireKind = null)
Create a new module source instance from a source ref string
at line 1092
Secret
secret(string $uri, string|null $cacheKey = null)
Creates a new secret.
at line 1107
Secret
setSecret(string $name, string $plaintext)
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.
at line 1115
Directory
sourceDir()
No description
at line 1124
SourceMap
sourceMap(string $filename, int $line, int $column)
Creates source map metadata.
at line 1136
TypeDef
typeDef()
Create a new TypeDef.
at line 1145
string
version()
Get the current Dagger Engine version.
at line 1154
Client
with(Directory|null $sdkSourceDir = null)
Configure the php-sdk constructor arguments.