@dagger.io/dagger 0.9.8 → 0.9.10

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.
Files changed (32) hide show
  1. package/dist/api/client.gen.d.ts +348 -49
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +537 -100
  4. package/dist/entrypoint/entrypoint.js +2 -1
  5. package/dist/entrypoint/invoke.d.ts.map +1 -1
  6. package/dist/entrypoint/invoke.js +25 -5
  7. package/dist/entrypoint/load.d.ts +43 -1
  8. package/dist/entrypoint/load.d.ts.map +1 -1
  9. package/dist/entrypoint/load.js +109 -2
  10. package/dist/entrypoint/register.d.ts.map +1 -1
  11. package/dist/entrypoint/register.js +7 -3
  12. package/dist/introspector/decorators/decorators.d.ts +3 -3
  13. package/dist/introspector/decorators/decorators.d.ts.map +1 -1
  14. package/dist/introspector/registry/registry.d.ts +5 -3
  15. package/dist/introspector/registry/registry.d.ts.map +1 -1
  16. package/dist/introspector/registry/registry.js +20 -28
  17. package/dist/introspector/scanner/metadata.d.ts +1 -0
  18. package/dist/introspector/scanner/metadata.d.ts.map +1 -1
  19. package/dist/introspector/scanner/scan.d.ts +5 -1
  20. package/dist/introspector/scanner/scan.d.ts.map +1 -1
  21. package/dist/introspector/scanner/scan.js +38 -5
  22. package/dist/introspector/scanner/serialize.d.ts.map +1 -1
  23. package/dist/introspector/scanner/serialize.js +8 -2
  24. package/dist/introspector/scanner/typeDefs.d.ts +3 -0
  25. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
  26. package/dist/introspector/scanner/utils.d.ts +18 -2
  27. package/dist/introspector/scanner/utils.d.ts.map +1 -1
  28. package/dist/introspector/scanner/utils.js +85 -12
  29. package/dist/provisioning/default.d.ts +1 -1
  30. package/dist/provisioning/default.d.ts.map +1 -1
  31. package/dist/provisioning/default.js +1 -1
  32. package/package.json +1 -1
@@ -165,11 +165,11 @@ export type ContainerPublishOpts = {
165
165
  */
166
166
  mediaTypes?: ImageMediaTypes;
167
167
  };
168
- export type ContainerShellOpts = {
168
+ export type ContainerTerminalOpts = {
169
169
  /**
170
- * If set, override the container's default shell and invoke these arguments instead.
170
+ * If set, override the container's default terminal command and invoke these command arguments instead.
171
171
  */
172
- args?: string[];
172
+ cmd?: string[];
173
173
  };
174
174
  export type ContainerWithDirectoryOpts = {
175
175
  /**
@@ -257,6 +257,20 @@ export type ContainerWithFileOpts = {
257
257
  */
258
258
  owner?: string;
259
259
  };
260
+ export type ContainerWithFilesOpts = {
261
+ /**
262
+ * Permission given to the copied files (e.g., 0600).
263
+ */
264
+ permissions?: number;
265
+ /**
266
+ * A user:group to set for the files.
267
+ *
268
+ * The user and group can either be an ID (1000:1000) or a name (foo:bar).
269
+ *
270
+ * If the group is omitted, it defaults to the same as the user.
271
+ */
272
+ owner?: string;
273
+ };
260
274
  export type ContainerWithMountedCacheOpts = {
261
275
  /**
262
276
  * Identifier of the directory to use as the cache volume's root.
@@ -377,13 +391,13 @@ export type CurrentModuleID = string & {
377
391
  };
378
392
  export type DirectoryAsModuleOpts = {
379
393
  /**
380
- * An optional subpath of the directory which contains the module's source code.
394
+ * An optional subpath of the directory which contains the module's configuration file.
381
395
  *
382
396
  * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
383
397
  *
384
398
  * If not set, the module source code is loaded from the root of the directory.
385
399
  */
386
- sourceSubpath?: string;
400
+ sourceRootPath?: string;
387
401
  };
388
402
  export type DirectoryDockerBuildOpts = {
389
403
  /**
@@ -441,6 +455,12 @@ export type DirectoryWithFileOpts = {
441
455
  */
442
456
  permissions?: number;
443
457
  };
458
+ export type DirectoryWithFilesOpts = {
459
+ /**
460
+ * Permission given to the copied files (e.g., 0600).
461
+ */
462
+ permissions?: number;
463
+ };
444
464
  export type DirectoryWithNewDirectoryOpts = {
445
465
  /**
446
466
  * Permission granted to the created directory (e.g., 0777).
@@ -774,10 +794,6 @@ export type ClientModuleDependencyOpts = {
774
794
  name?: string;
775
795
  };
776
796
  export type ClientModuleSourceOpts = {
777
- /**
778
- * An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
779
- */
780
- rootDirectory?: Directory;
781
797
  /**
782
798
  * If true, enforce that the source is a stable version for source kinds that support versioning.
783
799
  */
@@ -816,8 +832,16 @@ export type ServiceStopOpts = {
816
832
  kill?: boolean;
817
833
  };
818
834
  export type ServiceUpOpts = {
835
+ /**
836
+ * List of frontend/backend port mappings to forward.
837
+ *
838
+ * Frontend is the port accepting traffic on the host, backend is the service port.
839
+ */
819
840
  ports?: PortForward[];
820
- native?: boolean;
841
+ /**
842
+ * Bind each tunnel port to a random port on the host.
843
+ */
844
+ random?: boolean;
821
845
  };
822
846
  /**
823
847
  * The `ServiceID` scalar type represents an identifier for an object of type Service.
@@ -1129,11 +1153,6 @@ export declare class Container extends BaseClient {
1129
1153
  * Retrieves this container's root filesystem. Mounts are not included.
1130
1154
  */
1131
1155
  rootfs: () => Directory;
1132
- /**
1133
- * Return an interactive terminal for this container using its configured shell if not overridden by args (or sh as a fallback default).
1134
- * @param opts.args If set, override the container's default shell and invoke these arguments instead.
1135
- */
1136
- shell: (opts?: ContainerShellOpts) => Terminal;
1137
1156
  /**
1138
1157
  * The error stream of the last executed command.
1139
1158
  *
@@ -1152,6 +1171,11 @@ export declare class Container extends BaseClient {
1152
1171
  * It doesn't run the default command if no exec has been set.
1153
1172
  */
1154
1173
  sync: () => Promise<Container>;
1174
+ /**
1175
+ * Return an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
1176
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
1177
+ */
1178
+ terminal: (opts?: ContainerTerminalOpts) => Terminal;
1155
1179
  /**
1156
1180
  * Retrieves the user to be set for all commands.
1157
1181
  */
@@ -1162,10 +1186,10 @@ export declare class Container extends BaseClient {
1162
1186
  */
1163
1187
  withDefaultArgs: (args: string[]) => Container;
1164
1188
  /**
1165
- * Set the default command to invoke for the "shell" API.
1166
- * @param args The args of the command to set the default shell to.
1189
+ * Set the default command to invoke for the container's terminal API.
1190
+ * @param args The args of the command.
1167
1191
  */
1168
- withDefaultShell: (args: string[]) => Container;
1192
+ withDefaultTerminalCmd: (args: string[]) => Container;
1169
1193
  /**
1170
1194
  * Retrieves this container plus a directory written at the given path.
1171
1195
  * @param path Location of the written directory (e.g., "/tmp/directory").
@@ -1233,6 +1257,18 @@ export declare class Container extends BaseClient {
1233
1257
  * If the group is omitted, it defaults to the same as the user.
1234
1258
  */
1235
1259
  withFile: (path: string, source: File, opts?: ContainerWithFileOpts) => Container;
1260
+ /**
1261
+ * Retrieves this container plus the contents of the given files copied to the given path.
1262
+ * @param path Location where copied files should be placed (e.g., "/src").
1263
+ * @param sources Identifiers of the files to copy.
1264
+ * @param opts.permissions Permission given to the copied files (e.g., 0600).
1265
+ * @param opts.owner A user:group to set for the files.
1266
+ *
1267
+ * The user and group can either be an ID (1000:1000) or a name (foo:bar).
1268
+ *
1269
+ * If the group is omitted, it defaults to the same as the user.
1270
+ */
1271
+ withFiles: (path: string, sources: File[], opts?: ContainerWithFilesOpts) => Container;
1236
1272
  /**
1237
1273
  * Indicate that subsequent operations should be featured more prominently in the UI.
1238
1274
  */
@@ -1493,7 +1529,7 @@ export declare class Directory extends BaseClient {
1493
1529
  id: () => Promise<DirectoryID>;
1494
1530
  /**
1495
1531
  * Load the directory as a Dagger module
1496
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1532
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1497
1533
  *
1498
1534
  * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
1499
1535
  *
@@ -1567,6 +1603,13 @@ export declare class Directory extends BaseClient {
1567
1603
  * @param opts.permissions Permission given to the copied file (e.g., 0600).
1568
1604
  */
1569
1605
  withFile: (path: string, source: File, opts?: DirectoryWithFileOpts) => Directory;
1606
+ /**
1607
+ * Retrieves this directory plus the contents of the given files copied to the given path.
1608
+ * @param path Location where copied files should be placed (e.g., "/src").
1609
+ * @param sources Identifiers of the files to copy.
1610
+ * @param opts.permissions Permission given to the copied files (e.g., 0600).
1611
+ */
1612
+ withFiles: (path: string, sources: File[], opts?: DirectoryWithFilesOpts) => Directory;
1570
1613
  /**
1571
1614
  * Retrieves this directory plus a new directory created at the given path.
1572
1615
  * @param path Location of the directory created (e.g., "/logs").
@@ -1622,7 +1665,13 @@ export declare class EnvVariable extends BaseClient {
1622
1665
  * A unique identifier for this EnvVariable.
1623
1666
  */
1624
1667
  id: () => Promise<EnvVariableID>;
1668
+ /**
1669
+ * The environment variable name.
1670
+ */
1625
1671
  name: () => Promise<string>;
1672
+ /**
1673
+ * The environment variable value.
1674
+ */
1626
1675
  value: () => Promise<string>;
1627
1676
  }
1628
1677
  /**
@@ -1645,8 +1694,17 @@ export declare class FieldTypeDef extends BaseClient {
1645
1694
  * A unique identifier for this FieldTypeDef.
1646
1695
  */
1647
1696
  id: () => Promise<FieldTypeDefID>;
1697
+ /**
1698
+ * A doc string for the field, if any.
1699
+ */
1648
1700
  description: () => Promise<string>;
1701
+ /**
1702
+ * The name of the field in lowerCamelCase format.
1703
+ */
1649
1704
  name: () => Promise<string>;
1705
+ /**
1706
+ * The type of the field.
1707
+ */
1650
1708
  typeDef: () => TypeDef;
1651
1709
  }
1652
1710
  /**
@@ -1726,9 +1784,21 @@ export declare class Function_ extends BaseClient {
1726
1784
  * A unique identifier for this Function.
1727
1785
  */
1728
1786
  id: () => Promise<FunctionID>;
1787
+ /**
1788
+ * Arguments accepted by the function, if any.
1789
+ */
1729
1790
  args: () => Promise<FunctionArg[]>;
1791
+ /**
1792
+ * A doc string for the function, if any.
1793
+ */
1730
1794
  description: () => Promise<string>;
1795
+ /**
1796
+ * The name of the function.
1797
+ */
1731
1798
  name: () => Promise<string>;
1799
+ /**
1800
+ * The type returned by the function.
1801
+ */
1732
1802
  returnType: () => TypeDef;
1733
1803
  /**
1734
1804
  * Returns the function with the provided argument
@@ -1771,9 +1841,21 @@ export declare class FunctionArg extends BaseClient {
1771
1841
  * A unique identifier for this FunctionArg.
1772
1842
  */
1773
1843
  id: () => Promise<FunctionArgID>;
1844
+ /**
1845
+ * A default value to use for this argument when not explicitly set by the caller, if any.
1846
+ */
1774
1847
  defaultValue: () => Promise<JSON>;
1848
+ /**
1849
+ * A doc string for the argument, if any.
1850
+ */
1775
1851
  description: () => Promise<string>;
1852
+ /**
1853
+ * The name of the argument in lowerCamelCase format.
1854
+ */
1776
1855
  name: () => Promise<string>;
1856
+ /**
1857
+ * The type of the argument.
1858
+ */
1777
1859
  typeDef: () => TypeDef;
1778
1860
  }
1779
1861
  /**
@@ -1796,9 +1878,21 @@ export declare class FunctionCall extends BaseClient {
1796
1878
  * A unique identifier for this FunctionCall.
1797
1879
  */
1798
1880
  id: () => Promise<FunctionCallID>;
1881
+ /**
1882
+ * The argument values the function is being invoked with.
1883
+ */
1799
1884
  inputArgs: () => Promise<FunctionCallArgValue[]>;
1885
+ /**
1886
+ * The name of the function being called.
1887
+ */
1800
1888
  name: () => Promise<string>;
1889
+ /**
1890
+ * The value of the parent object of the function being called. If the function is top-level to the module, this is always an empty object.
1891
+ */
1801
1892
  parent: () => Promise<JSON>;
1893
+ /**
1894
+ * The name of the parent object of the function being called. If the function is top-level to the module, this is the name of the module.
1895
+ */
1802
1896
  parentName: () => Promise<string>;
1803
1897
  /**
1804
1898
  * Set the return value of the function call to the provided value.
@@ -1824,7 +1918,13 @@ export declare class FunctionCallArgValue extends BaseClient {
1824
1918
  * A unique identifier for this FunctionCallArgValue.
1825
1919
  */
1826
1920
  id: () => Promise<FunctionCallArgValueID>;
1921
+ /**
1922
+ * The name of the argument.
1923
+ */
1827
1924
  name: () => Promise<string>;
1925
+ /**
1926
+ * The value of the argument represented as a JSON serialized string.
1927
+ */
1828
1928
  value: () => Promise<JSON>;
1829
1929
  }
1830
1930
  /**
@@ -1843,8 +1943,17 @@ export declare class GeneratedCode extends BaseClient {
1843
1943
  * A unique identifier for this GeneratedCode.
1844
1944
  */
1845
1945
  id: () => Promise<GeneratedCodeID>;
1946
+ /**
1947
+ * The directory containing the generated code.
1948
+ */
1846
1949
  code: () => Directory;
1950
+ /**
1951
+ * List of paths to mark generated in version control (i.e. .gitattributes).
1952
+ */
1847
1953
  vcsGeneratedPaths: () => Promise<string[]>;
1954
+ /**
1955
+ * List of paths to ignore in version control (i.e. .gitignore).
1956
+ */
1848
1957
  vcsIgnoredPaths: () => Promise<string[]>;
1849
1958
  /**
1850
1959
  * Set the list of paths to mark generated in version control.
@@ -1869,7 +1978,7 @@ export declare class GitModuleSource extends BaseClient {
1869
1978
  private readonly _cloneURL?;
1870
1979
  private readonly _commit?;
1871
1980
  private readonly _htmlURL?;
1872
- private readonly _sourceSubpath?;
1981
+ private readonly _rootSubpath?;
1873
1982
  private readonly _version?;
1874
1983
  /**
1875
1984
  * Constructor is used for internal usage only, do not create object from it.
@@ -1877,7 +1986,7 @@ export declare class GitModuleSource extends BaseClient {
1877
1986
  constructor(parent?: {
1878
1987
  queryTree?: QueryTree[];
1879
1988
  ctx: Context;
1880
- }, _id?: GitModuleSourceID, _cloneURL?: string, _commit?: string, _htmlURL?: string, _sourceSubpath?: string, _version?: string);
1989
+ }, _id?: GitModuleSourceID, _cloneURL?: string, _commit?: string, _htmlURL?: string, _rootSubpath?: string, _version?: string);
1881
1990
  /**
1882
1991
  * A unique identifier for this GitModuleSource.
1883
1992
  */
@@ -1886,12 +1995,25 @@ export declare class GitModuleSource extends BaseClient {
1886
1995
  * The URL from which the source's git repo can be cloned.
1887
1996
  */
1888
1997
  cloneURL: () => Promise<string>;
1998
+ /**
1999
+ * The resolved commit of the git repo this source points to.
2000
+ */
1889
2001
  commit: () => Promise<string>;
2002
+ /**
2003
+ * The directory containing everything needed to load load and use the module.
2004
+ */
2005
+ contextDirectory: () => Directory;
1890
2006
  /**
1891
2007
  * The URL to the source's git repo in a web browser
1892
2008
  */
1893
2009
  htmlURL: () => Promise<string>;
1894
- sourceSubpath: () => Promise<string>;
2010
+ /**
2011
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
2012
+ */
2013
+ rootSubpath: () => Promise<string>;
2014
+ /**
2015
+ * The specified version of the git repo this source points to.
2016
+ */
1895
2017
  version: () => Promise<string>;
1896
2018
  }
1897
2019
  /**
@@ -1948,6 +2070,11 @@ export declare class GitRepository extends BaseClient {
1948
2070
  * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
1949
2071
  */
1950
2072
  commit: (id: string) => GitRef;
2073
+ /**
2074
+ * Returns details of a ref.
2075
+ * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
2076
+ */
2077
+ ref: (name: string) => GitRef;
1951
2078
  /**
1952
2079
  * Returns details of a tag.
1953
2080
  * @param name Tag's name (e.g., "v0.3.9").
@@ -2041,7 +2168,13 @@ export declare class InputTypeDef extends BaseClient {
2041
2168
  * A unique identifier for this InputTypeDef.
2042
2169
  */
2043
2170
  id: () => Promise<InputTypeDefID>;
2171
+ /**
2172
+ * Static fields defined on this input object, if any.
2173
+ */
2044
2174
  fields: () => Promise<FieldTypeDef[]>;
2175
+ /**
2176
+ * The name of the input object.
2177
+ */
2045
2178
  name: () => Promise<string>;
2046
2179
  }
2047
2180
  /**
@@ -2063,9 +2196,21 @@ export declare class InterfaceTypeDef extends BaseClient {
2063
2196
  * A unique identifier for this InterfaceTypeDef.
2064
2197
  */
2065
2198
  id: () => Promise<InterfaceTypeDefID>;
2199
+ /**
2200
+ * The doc string for the interface, if any.
2201
+ */
2066
2202
  description: () => Promise<string>;
2203
+ /**
2204
+ * Functions defined on this interface, if any.
2205
+ */
2067
2206
  functions: () => Promise<Function_[]>;
2207
+ /**
2208
+ * The name of the interface.
2209
+ */
2068
2210
  name: () => Promise<string>;
2211
+ /**
2212
+ * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
2213
+ */
2069
2214
  sourceModuleName: () => Promise<string>;
2070
2215
  }
2071
2216
  /**
@@ -2086,7 +2231,13 @@ export declare class Label extends BaseClient {
2086
2231
  * A unique identifier for this Label.
2087
2232
  */
2088
2233
  id: () => Promise<LabelID>;
2234
+ /**
2235
+ * The label name.
2236
+ */
2089
2237
  name: () => Promise<string>;
2238
+ /**
2239
+ * The label value.
2240
+ */
2090
2241
  value: () => Promise<string>;
2091
2242
  }
2092
2243
  /**
@@ -2105,6 +2256,9 @@ export declare class ListTypeDef extends BaseClient {
2105
2256
  * A unique identifier for this ListTypeDef.
2106
2257
  */
2107
2258
  id: () => Promise<ListTypeDefID>;
2259
+ /**
2260
+ * The type of the elements in the list.
2261
+ */
2108
2262
  elementTypeDef: () => TypeDef;
2109
2263
  }
2110
2264
  /**
@@ -2112,19 +2266,26 @@ export declare class ListTypeDef extends BaseClient {
2112
2266
  */
2113
2267
  export declare class LocalModuleSource extends BaseClient {
2114
2268
  private readonly _id?;
2115
- private readonly _sourceSubpath?;
2269
+ private readonly _rootSubpath?;
2116
2270
  /**
2117
2271
  * Constructor is used for internal usage only, do not create object from it.
2118
2272
  */
2119
2273
  constructor(parent?: {
2120
2274
  queryTree?: QueryTree[];
2121
2275
  ctx: Context;
2122
- }, _id?: LocalModuleSourceID, _sourceSubpath?: string);
2276
+ }, _id?: LocalModuleSourceID, _rootSubpath?: string);
2123
2277
  /**
2124
2278
  * A unique identifier for this LocalModuleSource.
2125
2279
  */
2126
2280
  id: () => Promise<LocalModuleSourceID>;
2127
- sourceSubpath: () => Promise<string>;
2281
+ /**
2282
+ * The directory containing everything needed to load load and use the module.
2283
+ */
2284
+ contextDirectory: () => Directory;
2285
+ /**
2286
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
2287
+ */
2288
+ rootSubpath: () => Promise<string>;
2128
2289
  }
2129
2290
  /**
2130
2291
  * A Dagger module.
@@ -2146,21 +2307,49 @@ export declare class Module_ extends BaseClient {
2146
2307
  * A unique identifier for this Module.
2147
2308
  */
2148
2309
  id: () => Promise<ModuleID>;
2310
+ /**
2311
+ * Modules used by this module.
2312
+ */
2149
2313
  dependencies: () => Promise<Module_[]>;
2314
+ /**
2315
+ * The dependencies as configured by the module.
2316
+ */
2150
2317
  dependencyConfig: () => Promise<ModuleDependency[]>;
2318
+ /**
2319
+ * The doc string of the module, if any
2320
+ */
2151
2321
  description: () => Promise<string>;
2152
2322
  /**
2153
- * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run.
2323
+ * The generated files and directories made on top of the module source's context directory.
2154
2324
  */
2155
- generatedSourceRootDirectory: () => Directory;
2325
+ generatedContextDiff: () => Directory;
2326
+ /**
2327
+ * The module source's context plus any configuration and source files created by codegen.
2328
+ */
2329
+ generatedContextDirectory: () => Directory;
2156
2330
  /**
2157
2331
  * Retrieves the module with the objects loaded via its SDK.
2158
2332
  */
2159
2333
  initialize: () => Module_;
2334
+ /**
2335
+ * Interfaces served by this module.
2336
+ */
2160
2337
  interfaces: () => Promise<TypeDef[]>;
2338
+ /**
2339
+ * The name of the module
2340
+ */
2161
2341
  name: () => Promise<string>;
2342
+ /**
2343
+ * Objects served by this module.
2344
+ */
2162
2345
  objects: () => Promise<TypeDef[]>;
2346
+ /**
2347
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
2348
+ */
2163
2349
  runtime: () => Container;
2350
+ /**
2351
+ * The SDK used by this module. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
2352
+ */
2164
2353
  sdk: () => Promise<string>;
2165
2354
  /**
2166
2355
  * Serve a module's API in the current session.
@@ -2168,12 +2357,10 @@ export declare class Module_ extends BaseClient {
2168
2357
  * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
2169
2358
  */
2170
2359
  serve: () => Promise<Void>;
2171
- source: () => ModuleSource;
2172
2360
  /**
2173
- * Update the module configuration to use the given dependencies.
2174
- * @param dependencies The dependency modules to install.
2361
+ * The source for the module.
2175
2362
  */
2176
- withDependencies: (dependencies: ModuleDependency[]) => Module_;
2363
+ source: () => ModuleSource;
2177
2364
  /**
2178
2365
  * Retrieves the module with the given description
2179
2366
  * @param description The description to set
@@ -2183,20 +2370,10 @@ export declare class Module_ extends BaseClient {
2183
2370
  * This module plus the given Interface type and associated functions
2184
2371
  */
2185
2372
  withInterface: (iface: TypeDef) => Module_;
2186
- /**
2187
- * Update the module configuration to use the given name.
2188
- * @param name The name to use.
2189
- */
2190
- withName: (name: string) => Module_;
2191
2373
  /**
2192
2374
  * This module plus the given Object type and associated functions.
2193
2375
  */
2194
2376
  withObject: (object: TypeDef) => Module_;
2195
- /**
2196
- * Update the module configuration to use the given SDK.
2197
- * @param sdk The SDK to use.
2198
- */
2199
- withSDK: (sdk: string) => Module_;
2200
2377
  /**
2201
2378
  * Retrieves the module with basic configuration loaded if present.
2202
2379
  * @param source The module source to initialize from.
@@ -2226,7 +2403,13 @@ export declare class ModuleDependency extends BaseClient {
2226
2403
  * A unique identifier for this ModuleDependency.
2227
2404
  */
2228
2405
  id: () => Promise<ModuleDependencyID>;
2406
+ /**
2407
+ * The name of the dependency module.
2408
+ */
2229
2409
  name: () => Promise<string>;
2410
+ /**
2411
+ * The source for the dependency module.
2412
+ */
2230
2413
  source: () => ModuleSource;
2231
2414
  }
2232
2415
  /**
@@ -2235,21 +2418,31 @@ export declare class ModuleDependency extends BaseClient {
2235
2418
  export declare class ModuleSource extends BaseClient {
2236
2419
  private readonly _id?;
2237
2420
  private readonly _asString?;
2421
+ private readonly _configExists?;
2238
2422
  private readonly _kind?;
2239
2423
  private readonly _moduleName?;
2240
- private readonly _subpath?;
2424
+ private readonly _moduleOriginalName?;
2425
+ private readonly _resolveContextPathFromCaller?;
2426
+ private readonly _sourceRootSubpath?;
2427
+ private readonly _sourceSubpath?;
2241
2428
  /**
2242
2429
  * Constructor is used for internal usage only, do not create object from it.
2243
2430
  */
2244
2431
  constructor(parent?: {
2245
2432
  queryTree?: QueryTree[];
2246
2433
  ctx: Context;
2247
- }, _id?: ModuleSourceID, _asString?: string, _kind?: ModuleSourceKind, _moduleName?: string, _subpath?: string);
2434
+ }, _id?: ModuleSourceID, _asString?: string, _configExists?: boolean, _kind?: ModuleSourceKind, _moduleName?: string, _moduleOriginalName?: string, _resolveContextPathFromCaller?: string, _sourceRootSubpath?: string, _sourceSubpath?: string);
2248
2435
  /**
2249
2436
  * A unique identifier for this ModuleSource.
2250
2437
  */
2251
2438
  id: () => Promise<ModuleSourceID>;
2439
+ /**
2440
+ * If the source is a of kind git, the git source representation of it.
2441
+ */
2252
2442
  asGitSource: () => GitModuleSource;
2443
+ /**
2444
+ * If the source is of kind local, the local source representation of it.
2445
+ */
2253
2446
  asLocalSource: () => LocalModuleSource;
2254
2447
  /**
2255
2448
  * Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
@@ -2260,25 +2453,80 @@ export declare class ModuleSource extends BaseClient {
2260
2453
  */
2261
2454
  asString: () => Promise<string>;
2262
2455
  /**
2263
- * The directory containing the actual module's source code, as determined from the root directory and subpath.
2456
+ * Returns whether the module source has a configuration file.
2457
+ */
2458
+ configExists: () => Promise<boolean>;
2459
+ /**
2460
+ * The directory containing everything needed to load load and use the module.
2461
+ */
2462
+ contextDirectory: () => Directory;
2463
+ /**
2464
+ * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
2465
+ */
2466
+ dependencies: () => Promise<ModuleDependency[]>;
2467
+ /**
2468
+ * The directory containing the module configuration and source code (source code may be in a subdir).
2264
2469
  * @param path The path from the source directory to select.
2265
2470
  */
2266
2471
  directory: (path: string) => Directory;
2472
+ /**
2473
+ * The kind of source (e.g. local, git, etc.)
2474
+ */
2267
2475
  kind: () => Promise<ModuleSourceKind>;
2268
2476
  /**
2269
- * If set, the name of the module this source references
2477
+ * If set, the name of the module this source references, including any overrides at runtime by callers.
2270
2478
  */
2271
2479
  moduleName: () => Promise<string>;
2480
+ /**
2481
+ * The original name of the module this source references, as defined in the module configuration.
2482
+ */
2483
+ moduleOriginalName: () => Promise<string>;
2484
+ /**
2485
+ * The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
2486
+ */
2487
+ resolveContextPathFromCaller: () => Promise<string>;
2272
2488
  /**
2273
2489
  * Resolve the provided module source arg as a dependency relative to this module source.
2274
2490
  * @param dep The dependency module source to resolve.
2275
2491
  */
2276
2492
  resolveDependency: (dep: ModuleSource) => ModuleSource;
2277
- rootDirectory: () => Directory;
2278
2493
  /**
2279
- * The path to the module subdirectory containing the actual module's source code.
2494
+ * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
2495
+ */
2496
+ resolveFromCaller: () => ModuleSource;
2497
+ /**
2498
+ * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.
2499
+ */
2500
+ sourceRootSubpath: () => Promise<string>;
2501
+ /**
2502
+ * The path relative to context of the module implementation source code.
2503
+ */
2504
+ sourceSubpath: () => Promise<string>;
2505
+ /**
2506
+ * Update the module source with a new context directory. Only valid for local sources.
2507
+ * @param dir The directory to set as the context directory.
2508
+ */
2509
+ withContextDirectory: (dir: Directory) => ModuleSource;
2510
+ /**
2511
+ * Append the provided dependencies to the module source's dependency list.
2512
+ * @param dependencies The dependencies to append.
2513
+ */
2514
+ withDependencies: (dependencies: ModuleDependency[]) => ModuleSource;
2515
+ /**
2516
+ * Update the module source with a new name.
2517
+ * @param name The name to set.
2518
+ */
2519
+ withName: (name: string) => ModuleSource;
2520
+ /**
2521
+ * Update the module source with a new SDK.
2522
+ * @param sdk The SDK to set.
2280
2523
  */
2281
- subpath: () => Promise<string>;
2524
+ withSDK: (sdk: string) => ModuleSource;
2525
+ /**
2526
+ * Update the module source with a new source subpath.
2527
+ * @param path The path to set as the source subpath.
2528
+ */
2529
+ withSourceSubpath: (path: string) => ModuleSource;
2282
2530
  /**
2283
2531
  * Call the provided function with current ModuleSource.
2284
2532
  *
@@ -2305,11 +2553,29 @@ export declare class ObjectTypeDef extends BaseClient {
2305
2553
  * A unique identifier for this ObjectTypeDef.
2306
2554
  */
2307
2555
  id: () => Promise<ObjectTypeDefID>;
2556
+ /**
2557
+ * The function used to construct new instances of this object, if any
2558
+ */
2308
2559
  constructor_: () => Function_;
2560
+ /**
2561
+ * The doc string for the object, if any.
2562
+ */
2309
2563
  description: () => Promise<string>;
2564
+ /**
2565
+ * Static fields defined on this object, if any.
2566
+ */
2310
2567
  fields: () => Promise<FieldTypeDef[]>;
2568
+ /**
2569
+ * Functions defined on this object, if any.
2570
+ */
2311
2571
  functions: () => Promise<Function_[]>;
2572
+ /**
2573
+ * The name of the object.
2574
+ */
2312
2575
  name: () => Promise<string>;
2576
+ /**
2577
+ * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
2578
+ */
2313
2579
  sourceModuleName: () => Promise<string>;
2314
2580
  }
2315
2581
  /**
@@ -2332,9 +2598,21 @@ export declare class Port extends BaseClient {
2332
2598
  * A unique identifier for this Port.
2333
2599
  */
2334
2600
  id: () => Promise<PortID>;
2601
+ /**
2602
+ * The port description.
2603
+ */
2335
2604
  description: () => Promise<string>;
2605
+ /**
2606
+ * Skip the health check when run as a service.
2607
+ */
2336
2608
  experimentalSkipHealthcheck: () => Promise<boolean>;
2609
+ /**
2610
+ * The port number.
2611
+ */
2337
2612
  port: () => Promise<number>;
2613
+ /**
2614
+ * The transport layer protocol.
2615
+ */
2338
2616
  protocol: () => Promise<NetworkProtocol>;
2339
2617
  }
2340
2618
  /**
@@ -2573,7 +2851,6 @@ export declare class Client extends BaseClient {
2573
2851
  /**
2574
2852
  * Create a new module source instance from a source ref string.
2575
2853
  * @param refString The string ref representation of the module source
2576
- * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
2577
2854
  * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
2578
2855
  */
2579
2856
  moduleSource: (refString: string, opts?: ClientModuleSourceOpts) => ModuleSource;
@@ -2686,6 +2963,10 @@ export declare class Service extends BaseClient {
2686
2963
  stop: (opts?: ServiceStopOpts) => Promise<Service>;
2687
2964
  /**
2688
2965
  * Creates a tunnel that forwards traffic from the caller's network to this service.
2966
+ * @param opts.ports List of frontend/backend port mappings to forward.
2967
+ *
2968
+ * Frontend is the port accepting traffic on the host, backend is the service port.
2969
+ * @param opts.random Bind each tunnel port to a random port on the host.
2689
2970
  */
2690
2971
  up: (opts?: ServiceUpOpts) => Promise<Void>;
2691
2972
  }
@@ -2746,11 +3027,29 @@ export declare class TypeDef extends BaseClient {
2746
3027
  * A unique identifier for this TypeDef.
2747
3028
  */
2748
3029
  id: () => Promise<TypeDefID>;
3030
+ /**
3031
+ * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
3032
+ */
2749
3033
  asInput: () => InputTypeDef;
3034
+ /**
3035
+ * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
3036
+ */
2750
3037
  asInterface: () => InterfaceTypeDef;
3038
+ /**
3039
+ * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
3040
+ */
2751
3041
  asList: () => ListTypeDef;
3042
+ /**
3043
+ * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
3044
+ */
2752
3045
  asObject: () => ObjectTypeDef;
3046
+ /**
3047
+ * The kind of type this is (e.g. primitive, list, object).
3048
+ */
2753
3049
  kind: () => Promise<TypeDefKind>;
3050
+ /**
3051
+ * Whether this type can be set to null. Defaults to false.
3052
+ */
2754
3053
  optional: () => Promise<boolean>;
2755
3054
  /**
2756
3055
  * Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.