(srv *dagql.Server)
| 33 | var _ SchemaResolvers = &hostSchema{} |
| 34 | |
| 35 | func (s *hostSchema) Install(srv *dagql.Server) { |
| 36 | dagql.Fields[*core.Query]{ |
| 37 | dagql.Func("host", func(ctx context.Context, parent *core.Query, args struct{}) (*core.Host, error) { |
| 38 | return parent.NewHost(), nil |
| 39 | }).Doc(`Queries the host environment.`), |
| 40 | |
| 41 | dagql.NodeFunc("_builtinContainer", s.builtinContainer). |
| 42 | IsPersistable(). |
| 43 | Doc("Retrieves a container builtin to the engine."), |
| 44 | }.Install(srv) |
| 45 | |
| 46 | dagql.Fields[*core.Host]{ |
| 47 | dagql.NodeFunc("directory", s.directory). |
| 48 | WithInput(dagql.RequestedCacheInput("noCache")). |
| 49 | Doc(`Accesses a directory on the host.`). |
| 50 | Args( |
| 51 | dagql.Arg("path").Doc(`Location of the directory to access (e.g., ".").`), |
| 52 | dagql.Arg("exclude").Doc(`Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).`), |
| 53 | dagql.Arg("include").Doc(`Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).`), |
| 54 | dagql.Arg("noCache").Doc(`If true, the directory will always be reloaded from the host.`), |
| 55 | dagql.Arg("gitignore").Doc(`Apply .gitignore filter rules inside the directory`), |
| 56 | ), |
| 57 | |
| 58 | dagql.NodeFunc("file", s.file). |
| 59 | WithInput(dagql.RequestedCacheInput("noCache")). |
| 60 | Doc(`Accesses a file on the host.`). |
| 61 | Args( |
| 62 | dagql.Arg("path").Doc(`Location of the file to retrieve (e.g., "README.md").`), |
| 63 | dagql.Arg("noCache").Doc(`If true, the file will always be reloaded from the host.`), |
| 64 | ), |
| 65 | |
| 66 | dagql.NodeFunc("findUp", s.findUp). |
| 67 | WithInput(dagql.RequestedCacheInput("noCache")). |
| 68 | Doc(`Search for a file or directory by walking up the tree from system workdir. Return its relative path. If no match, return null`). |
| 69 | Args( |
| 70 | dagql.Arg("name").Doc(`name of the file or directory to search for`), |
| 71 | ), |
| 72 | |
| 73 | dagql.NodeFunc("unixSocket", s.socket). |
| 74 | WithInput(dagql.PerClientInput). |
| 75 | Doc(`Accesses a Unix socket on the host.`). |
| 76 | Args( |
| 77 | dagql.Arg("path").Doc(`Location of the Unix socket (e.g., "/var/run/docker.sock").`), |
| 78 | ), |
| 79 | |
| 80 | dagql.NodeFunc("_sshAuthSocket", s.sshAuthSocket). |
| 81 | WithInput(dagql.PerCallInput). |
| 82 | Doc(`Accesses the SSH auth socket on the host and returns a socket scoped to SSH identities.`). |
| 83 | Args( |
| 84 | dagql.Arg("source").Doc(`Optional source socket to scope. If not set, uses the caller's SSH_AUTH_SOCK.`), |
| 85 | ), |
| 86 | |
| 87 | dagql.Func("tunnel", s.tunnel). |
| 88 | WithInput(dagql.PerClientInput). |
| 89 | Doc(`Creates a tunnel that forwards traffic from the host to a service.`). |
| 90 | Args( |
| 91 | dagql.Arg("service").Doc(`Service to send traffic from the tunnel.`), |
| 92 | dagql.Arg("native").Doc( |
nothing calls this directly
no test coverage detected