@dagger.io/dagger 0.9.7 → 0.9.9

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 (33) hide show
  1. package/dist/api/client.gen.d.ts +648 -59
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +1231 -99
  4. package/dist/common/utils.d.ts +3 -0
  5. package/dist/common/utils.d.ts.map +1 -1
  6. package/dist/entrypoint/entrypoint.js +2 -1
  7. package/dist/entrypoint/invoke.d.ts.map +1 -1
  8. package/dist/entrypoint/invoke.js +25 -5
  9. package/dist/entrypoint/load.d.ts +43 -1
  10. package/dist/entrypoint/load.d.ts.map +1 -1
  11. package/dist/entrypoint/load.js +116 -11
  12. package/dist/entrypoint/register.d.ts.map +1 -1
  13. package/dist/entrypoint/register.js +9 -5
  14. package/dist/introspector/decorators/decorators.d.ts +3 -3
  15. package/dist/introspector/decorators/decorators.d.ts.map +1 -1
  16. package/dist/introspector/registry/registry.d.ts +5 -3
  17. package/dist/introspector/registry/registry.d.ts.map +1 -1
  18. package/dist/introspector/registry/registry.js +23 -39
  19. package/dist/introspector/scanner/metadata.d.ts +1 -0
  20. package/dist/introspector/scanner/metadata.d.ts.map +1 -1
  21. package/dist/introspector/scanner/scan.d.ts +5 -1
  22. package/dist/introspector/scanner/scan.d.ts.map +1 -1
  23. package/dist/introspector/scanner/scan.js +38 -5
  24. package/dist/introspector/scanner/serialize.d.ts.map +1 -1
  25. package/dist/introspector/scanner/serialize.js +8 -2
  26. package/dist/introspector/scanner/typeDefs.d.ts +3 -0
  27. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
  28. package/dist/introspector/scanner/utils.d.ts +18 -2
  29. package/dist/introspector/scanner/utils.d.ts.map +1 -1
  30. package/dist/introspector/scanner/utils.js +85 -12
  31. package/dist/provisioning/default.d.ts +1 -1
  32. package/dist/provisioning/default.js +1 -1
  33. package/package.json +6 -6
@@ -165,6 +165,12 @@ export type ContainerPublishOpts = {
165
165
  */
166
166
  mediaTypes?: ImageMediaTypes;
167
167
  };
168
+ export type ContainerTerminalOpts = {
169
+ /**
170
+ * If set, override the container's default terminal command and invoke these command arguments instead.
171
+ */
172
+ cmd?: string[];
173
+ };
168
174
  export type ContainerWithDirectoryOpts = {
169
175
  /**
170
176
  * Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
@@ -232,6 +238,10 @@ export type ContainerWithExposedPortOpts = {
232
238
  * Optional port description
233
239
  */
234
240
  description?: string;
241
+ /**
242
+ * Skip the health check when run as a service.
243
+ */
244
+ experimentalSkipHealthcheck?: boolean;
235
245
  };
236
246
  export type ContainerWithFileOpts = {
237
247
  /**
@@ -349,15 +359,31 @@ export type ContainerWithoutExposedPortOpts = {
349
359
  export type ContainerID = string & {
350
360
  __ContainerID: never;
351
361
  };
362
+ export type CurrentModuleWorkdirOpts = {
363
+ /**
364
+ * Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
365
+ */
366
+ exclude?: string[];
367
+ /**
368
+ * Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
369
+ */
370
+ include?: string[];
371
+ };
372
+ /**
373
+ * The `CurrentModuleID` scalar type represents an identifier for an object of type CurrentModule.
374
+ */
375
+ export type CurrentModuleID = string & {
376
+ __CurrentModuleID: never;
377
+ };
352
378
  export type DirectoryAsModuleOpts = {
353
379
  /**
354
- * An optional subpath of the directory which contains the module's source code.
380
+ * An optional subpath of the directory which contains the module's configuration file.
355
381
  *
356
382
  * 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.
357
383
  *
358
384
  * If not set, the module source code is loaded from the root of the directory.
359
385
  */
360
- sourceSubpath?: string;
386
+ sourceRootPath?: string;
361
387
  };
362
388
  export type DirectoryDockerBuildOpts = {
363
389
  /**
@@ -497,6 +523,12 @@ export type FunctionID = string & {
497
523
  export type GeneratedCodeID = string & {
498
524
  __GeneratedCodeID: never;
499
525
  };
526
+ /**
527
+ * The `GitModuleSourceID` scalar type represents an identifier for an object of type GitModuleSource.
528
+ */
529
+ export type GitModuleSourceID = string & {
530
+ __GitModuleSourceID: never;
531
+ };
500
532
  export type GitRefTreeOpts = {
501
533
  /**
502
534
  * DEPRECATED: This option should be passed to `git` instead.
@@ -583,6 +615,12 @@ export declare enum ImageMediaTypes {
583
615
  Dockermediatypes = "DockerMediaTypes",
584
616
  Ocimediatypes = "OCIMediaTypes"
585
617
  }
618
+ /**
619
+ * The `InputTypeDefID` scalar type represents an identifier for an object of type InputTypeDef.
620
+ */
621
+ export type InputTypeDefID = string & {
622
+ __InputTypeDefID: never;
623
+ };
586
624
  /**
587
625
  * The `InterfaceTypeDefID` scalar type represents an identifier for an object of type InterfaceTypeDef.
588
626
  */
@@ -607,21 +645,17 @@ export type LabelID = string & {
607
645
  export type ListTypeDefID = string & {
608
646
  __ListTypeDefID: never;
609
647
  };
610
- export type ModuleWithSourceOpts = {
611
- /**
612
- * An optional subpath of the directory which contains the module's source code.
613
- *
614
- * 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.
615
- *
616
- * If not set, the module source code is loaded from the root of the directory.
617
- */
618
- subpath?: string;
648
+ /**
649
+ * The `LocalModuleSourceID` scalar type represents an identifier for an object of type LocalModuleSource.
650
+ */
651
+ export type LocalModuleSourceID = string & {
652
+ __LocalModuleSourceID: never;
619
653
  };
620
654
  /**
621
- * The `ModuleConfigID` scalar type represents an identifier for an object of type ModuleConfig.
655
+ * The `ModuleDependencyID` scalar type represents an identifier for an object of type ModuleDependency.
622
656
  */
623
- export type ModuleConfigID = string & {
624
- __ModuleConfigID: never;
657
+ export type ModuleDependencyID = string & {
658
+ __ModuleDependencyID: never;
625
659
  };
626
660
  /**
627
661
  * The `ModuleID` scalar type represents an identifier for an object of type Module.
@@ -629,6 +663,19 @@ export type ModuleConfigID = string & {
629
663
  export type ModuleID = string & {
630
664
  __ModuleID: never;
631
665
  };
666
+ /**
667
+ * The `ModuleSourceID` scalar type represents an identifier for an object of type ModuleSource.
668
+ */
669
+ export type ModuleSourceID = string & {
670
+ __ModuleSourceID: never;
671
+ };
672
+ /**
673
+ * The kind of module source.
674
+ */
675
+ export declare enum ModuleSourceKind {
676
+ GitSource = "GIT_SOURCE",
677
+ LocalSource = "LOCAL_SOURCE"
678
+ }
632
679
  /**
633
680
  * Transport layer network protocol associated to a port.
634
681
  */
@@ -720,8 +767,17 @@ export type ClientHttpOpts = {
720
767
  */
721
768
  experimentalServiceHost?: Service;
722
769
  };
723
- export type ClientModuleConfigOpts = {
724
- subpath?: string;
770
+ export type ClientModuleDependencyOpts = {
771
+ /**
772
+ * If set, the name to use for the dependency. Otherwise, once installed to a parent module, the name of the dependency module will be used by default.
773
+ */
774
+ name?: string;
775
+ };
776
+ export type ClientModuleSourceOpts = {
777
+ /**
778
+ * If true, enforce that the source is a stable version for source kinds that support versioning.
779
+ */
780
+ stable?: boolean;
725
781
  };
726
782
  export type ClientPipelineOpts = {
727
783
  /**
@@ -749,6 +805,24 @@ export type ServiceEndpointOpts = {
749
805
  */
750
806
  scheme?: string;
751
807
  };
808
+ export type ServiceStopOpts = {
809
+ /**
810
+ * Immediately kill the service without waiting for a graceful exit
811
+ */
812
+ kill?: boolean;
813
+ };
814
+ export type ServiceUpOpts = {
815
+ /**
816
+ * List of frontend/backend port mappings to forward.
817
+ *
818
+ * Frontend is the port accepting traffic on the host, backend is the service port.
819
+ */
820
+ ports?: PortForward[];
821
+ /**
822
+ * Bind each tunnel port to a random port on the host.
823
+ */
824
+ random?: boolean;
825
+ };
752
826
  /**
753
827
  * The `ServiceID` scalar type represents an identifier for an object of type Service.
754
828
  */
@@ -761,6 +835,12 @@ export type ServiceID = string & {
761
835
  export type SocketID = string & {
762
836
  __SocketID: never;
763
837
  };
838
+ /**
839
+ * The `TerminalID` scalar type represents an identifier for an object of type Terminal.
840
+ */
841
+ export type TerminalID = string & {
842
+ __TerminalID: never;
843
+ };
764
844
  export type TypeDefWithFieldOpts = {
765
845
  /**
766
846
  * A doc string for the field, if any
@@ -787,6 +867,10 @@ export declare enum TypeDefKind {
787
867
  * A boolean value.
788
868
  */
789
869
  BooleanKind = "BOOLEAN_KIND",
870
+ /**
871
+ * A graphql input type, used only when representing the core API via TypeDefs.
872
+ */
873
+ InputKind = "INPUT_KIND",
790
874
  /**
791
875
  * An integer value.
792
876
  */
@@ -862,7 +946,6 @@ export declare class Container extends BaseClient {
862
946
  private readonly _label?;
863
947
  private readonly _platform?;
864
948
  private readonly _publish?;
865
- private readonly _shellEndpoint?;
866
949
  private readonly _stderr?;
867
950
  private readonly _stdout?;
868
951
  private readonly _sync?;
@@ -874,7 +957,7 @@ export declare class Container extends BaseClient {
874
957
  constructor(parent?: {
875
958
  queryTree?: QueryTree[];
876
959
  ctx: Context;
877
- }, _id?: ContainerID, _envVariable?: string, _export?: boolean, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _shellEndpoint?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
960
+ }, _id?: ContainerID, _envVariable?: string, _export?: boolean, _imageRef?: string, _label?: string, _platform?: Platform, _publish?: string, _stderr?: string, _stdout?: string, _sync?: ContainerID, _user?: string, _workdir?: string);
878
961
  /**
879
962
  * A unique identifier for this Container.
880
963
  */
@@ -1050,12 +1133,6 @@ export declare class Container extends BaseClient {
1050
1133
  * Retrieves this container's root filesystem. Mounts are not included.
1051
1134
  */
1052
1135
  rootfs: () => Directory;
1053
- /**
1054
- * Return a websocket endpoint that, if connected to, will start the container with a TTY streamed over the websocket.
1055
- *
1056
- * Primarily intended for internal use with the dagger CLI.
1057
- */
1058
- shellEndpoint: () => Promise<string>;
1059
1136
  /**
1060
1137
  * The error stream of the last executed command.
1061
1138
  *
@@ -1074,6 +1151,11 @@ export declare class Container extends BaseClient {
1074
1151
  * It doesn't run the default command if no exec has been set.
1075
1152
  */
1076
1153
  sync: () => Promise<Container>;
1154
+ /**
1155
+ * Return an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
1156
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
1157
+ */
1158
+ terminal: (opts?: ContainerTerminalOpts) => Terminal;
1077
1159
  /**
1078
1160
  * Retrieves the user to be set for all commands.
1079
1161
  */
@@ -1083,6 +1165,11 @@ export declare class Container extends BaseClient {
1083
1165
  * @param args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
1084
1166
  */
1085
1167
  withDefaultArgs: (args: string[]) => Container;
1168
+ /**
1169
+ * Set the default command to invoke for the container's terminal API.
1170
+ * @param args The args of the command.
1171
+ */
1172
+ withDefaultTerminalCmd: (args: string[]) => Container;
1086
1173
  /**
1087
1174
  * Retrieves this container plus a directory written at the given path.
1088
1175
  * @param path Location of the written directory (e.g., "/tmp/directory").
@@ -1135,6 +1222,7 @@ export declare class Container extends BaseClient {
1135
1222
  * @param port Port number to expose
1136
1223
  * @param opts.protocol Transport layer network protocol
1137
1224
  * @param opts.description Optional port description
1225
+ * @param opts.experimentalSkipHealthcheck Skip the health check when run as a service.
1138
1226
  */
1139
1227
  withExposedPort: (port: number, opts?: ContainerWithExposedPortOpts) => Container;
1140
1228
  /**
@@ -1351,6 +1439,44 @@ export declare class Container extends BaseClient {
1351
1439
  */
1352
1440
  with: (arg: (param: Container) => Container) => Container;
1353
1441
  }
1442
+ /**
1443
+ * Reflective module API provided to functions at runtime.
1444
+ */
1445
+ export declare class CurrentModule extends BaseClient {
1446
+ private readonly _id?;
1447
+ private readonly _name?;
1448
+ /**
1449
+ * Constructor is used for internal usage only, do not create object from it.
1450
+ */
1451
+ constructor(parent?: {
1452
+ queryTree?: QueryTree[];
1453
+ ctx: Context;
1454
+ }, _id?: CurrentModuleID, _name?: string);
1455
+ /**
1456
+ * A unique identifier for this CurrentModule.
1457
+ */
1458
+ id: () => Promise<CurrentModuleID>;
1459
+ /**
1460
+ * The name of the module being executed in
1461
+ */
1462
+ name: () => Promise<string>;
1463
+ /**
1464
+ * The directory containing the module's source code loaded into the engine (plus any generated code that may have been created).
1465
+ */
1466
+ source: () => Directory;
1467
+ /**
1468
+ * Load a directory from the module's scratch working directory, including any changes that may have been made to it during module function execution.
1469
+ * @param path Location of the directory to access (e.g., ".").
1470
+ * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1471
+ * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1472
+ */
1473
+ workdir: (path: string, opts?: CurrentModuleWorkdirOpts) => Directory;
1474
+ /**
1475
+ * Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.Load a file from the module's scratch working directory, including any changes that may have been made to it during module function execution.
1476
+ * @param path Location of the file to retrieve (e.g., "README.md").
1477
+ */
1478
+ workdirFile: (path: string) => File;
1479
+ }
1354
1480
  /**
1355
1481
  * A directory.
1356
1482
  */
@@ -1371,7 +1497,7 @@ export declare class Directory extends BaseClient {
1371
1497
  id: () => Promise<DirectoryID>;
1372
1498
  /**
1373
1499
  * Load the directory as a Dagger module
1374
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1500
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1375
1501
  *
1376
1502
  * 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.
1377
1503
  *
@@ -1500,7 +1626,13 @@ export declare class EnvVariable extends BaseClient {
1500
1626
  * A unique identifier for this EnvVariable.
1501
1627
  */
1502
1628
  id: () => Promise<EnvVariableID>;
1629
+ /**
1630
+ * The environment variable name.
1631
+ */
1503
1632
  name: () => Promise<string>;
1633
+ /**
1634
+ * The environment variable value.
1635
+ */
1504
1636
  value: () => Promise<string>;
1505
1637
  }
1506
1638
  /**
@@ -1523,8 +1655,17 @@ export declare class FieldTypeDef extends BaseClient {
1523
1655
  * A unique identifier for this FieldTypeDef.
1524
1656
  */
1525
1657
  id: () => Promise<FieldTypeDefID>;
1658
+ /**
1659
+ * A doc string for the field, if any.
1660
+ */
1526
1661
  description: () => Promise<string>;
1662
+ /**
1663
+ * The name of the field in lowerCamelCase format.
1664
+ */
1527
1665
  name: () => Promise<string>;
1666
+ /**
1667
+ * The type of the field.
1668
+ */
1528
1669
  typeDef: () => TypeDef;
1529
1670
  }
1530
1671
  /**
@@ -1604,9 +1745,21 @@ export declare class Function_ extends BaseClient {
1604
1745
  * A unique identifier for this Function.
1605
1746
  */
1606
1747
  id: () => Promise<FunctionID>;
1748
+ /**
1749
+ * Arguments accepted by the function, if any.
1750
+ */
1607
1751
  args: () => Promise<FunctionArg[]>;
1752
+ /**
1753
+ * A doc string for the function, if any.
1754
+ */
1608
1755
  description: () => Promise<string>;
1756
+ /**
1757
+ * The name of the function.
1758
+ */
1609
1759
  name: () => Promise<string>;
1760
+ /**
1761
+ * The type returned by the function.
1762
+ */
1610
1763
  returnType: () => TypeDef;
1611
1764
  /**
1612
1765
  * Returns the function with the provided argument
@@ -1649,9 +1802,21 @@ export declare class FunctionArg extends BaseClient {
1649
1802
  * A unique identifier for this FunctionArg.
1650
1803
  */
1651
1804
  id: () => Promise<FunctionArgID>;
1805
+ /**
1806
+ * A default value to use for this argument when not explicitly set by the caller, if any.
1807
+ */
1652
1808
  defaultValue: () => Promise<JSON>;
1809
+ /**
1810
+ * A doc string for the argument, if any.
1811
+ */
1653
1812
  description: () => Promise<string>;
1813
+ /**
1814
+ * The name of the argument in lowerCamelCase format.
1815
+ */
1654
1816
  name: () => Promise<string>;
1817
+ /**
1818
+ * The type of the argument.
1819
+ */
1655
1820
  typeDef: () => TypeDef;
1656
1821
  }
1657
1822
  /**
@@ -1674,9 +1839,21 @@ export declare class FunctionCall extends BaseClient {
1674
1839
  * A unique identifier for this FunctionCall.
1675
1840
  */
1676
1841
  id: () => Promise<FunctionCallID>;
1842
+ /**
1843
+ * The argument values the function is being invoked with.
1844
+ */
1677
1845
  inputArgs: () => Promise<FunctionCallArgValue[]>;
1846
+ /**
1847
+ * The name of the function being called.
1848
+ */
1678
1849
  name: () => Promise<string>;
1850
+ /**
1851
+ * 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.
1852
+ */
1679
1853
  parent: () => Promise<JSON>;
1854
+ /**
1855
+ * 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.
1856
+ */
1680
1857
  parentName: () => Promise<string>;
1681
1858
  /**
1682
1859
  * Set the return value of the function call to the provided value.
@@ -1702,7 +1879,13 @@ export declare class FunctionCallArgValue extends BaseClient {
1702
1879
  * A unique identifier for this FunctionCallArgValue.
1703
1880
  */
1704
1881
  id: () => Promise<FunctionCallArgValueID>;
1882
+ /**
1883
+ * The name of the argument.
1884
+ */
1705
1885
  name: () => Promise<string>;
1886
+ /**
1887
+ * The value of the argument represented as a JSON serialized string.
1888
+ */
1706
1889
  value: () => Promise<JSON>;
1707
1890
  }
1708
1891
  /**
@@ -1721,8 +1904,17 @@ export declare class GeneratedCode extends BaseClient {
1721
1904
  * A unique identifier for this GeneratedCode.
1722
1905
  */
1723
1906
  id: () => Promise<GeneratedCodeID>;
1907
+ /**
1908
+ * The directory containing the generated code.
1909
+ */
1724
1910
  code: () => Directory;
1911
+ /**
1912
+ * List of paths to mark generated in version control (i.e. .gitattributes).
1913
+ */
1725
1914
  vcsGeneratedPaths: () => Promise<string[]>;
1915
+ /**
1916
+ * List of paths to ignore in version control (i.e. .gitignore).
1917
+ */
1726
1918
  vcsIgnoredPaths: () => Promise<string[]>;
1727
1919
  /**
1728
1920
  * Set the list of paths to mark generated in version control.
@@ -1739,6 +1931,52 @@ export declare class GeneratedCode extends BaseClient {
1739
1931
  */
1740
1932
  with: (arg: (param: GeneratedCode) => GeneratedCode) => GeneratedCode;
1741
1933
  }
1934
+ /**
1935
+ * Module source originating from a git repo.
1936
+ */
1937
+ export declare class GitModuleSource extends BaseClient {
1938
+ private readonly _id?;
1939
+ private readonly _cloneURL?;
1940
+ private readonly _commit?;
1941
+ private readonly _htmlURL?;
1942
+ private readonly _rootSubpath?;
1943
+ private readonly _version?;
1944
+ /**
1945
+ * Constructor is used for internal usage only, do not create object from it.
1946
+ */
1947
+ constructor(parent?: {
1948
+ queryTree?: QueryTree[];
1949
+ ctx: Context;
1950
+ }, _id?: GitModuleSourceID, _cloneURL?: string, _commit?: string, _htmlURL?: string, _rootSubpath?: string, _version?: string);
1951
+ /**
1952
+ * A unique identifier for this GitModuleSource.
1953
+ */
1954
+ id: () => Promise<GitModuleSourceID>;
1955
+ /**
1956
+ * The URL from which the source's git repo can be cloned.
1957
+ */
1958
+ cloneURL: () => Promise<string>;
1959
+ /**
1960
+ * The resolved commit of the git repo this source points to.
1961
+ */
1962
+ commit: () => Promise<string>;
1963
+ /**
1964
+ * The directory containing everything needed to load load and use the module.
1965
+ */
1966
+ contextDirectory: () => Directory;
1967
+ /**
1968
+ * The URL to the source's git repo in a web browser
1969
+ */
1970
+ htmlURL: () => Promise<string>;
1971
+ /**
1972
+ * 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).
1973
+ */
1974
+ rootSubpath: () => Promise<string>;
1975
+ /**
1976
+ * The specified version of the git repo this source points to.
1977
+ */
1978
+ version: () => Promise<string>;
1979
+ }
1742
1980
  /**
1743
1981
  * A git ref (tag, branch, or commit).
1744
1982
  */
@@ -1793,6 +2031,11 @@ export declare class GitRepository extends BaseClient {
1793
2031
  * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
1794
2032
  */
1795
2033
  commit: (id: string) => GitRef;
2034
+ /**
2035
+ * Returns details of a ref.
2036
+ * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
2037
+ */
2038
+ ref: (name: string) => GitRef;
1796
2039
  /**
1797
2040
  * Returns details of a tag.
1798
2041
  * @param name Tag's name (e.g., "v0.3.9").
@@ -1866,6 +2109,35 @@ export declare class Host extends BaseClient {
1866
2109
  */
1867
2110
  unixSocket: (path: string) => Socket;
1868
2111
  }
2112
+ /**
2113
+ * A graphql input type, which is essentially just a group of named args.
2114
+ * This is currently only used to represent pre-existing usage of graphql input types
2115
+ * in the core API. It is not used by user modules and shouldn't ever be as user
2116
+ * module accept input objects via their id rather than graphql input types.
2117
+ */
2118
+ export declare class InputTypeDef extends BaseClient {
2119
+ private readonly _id?;
2120
+ private readonly _name?;
2121
+ /**
2122
+ * Constructor is used for internal usage only, do not create object from it.
2123
+ */
2124
+ constructor(parent?: {
2125
+ queryTree?: QueryTree[];
2126
+ ctx: Context;
2127
+ }, _id?: InputTypeDefID, _name?: string);
2128
+ /**
2129
+ * A unique identifier for this InputTypeDef.
2130
+ */
2131
+ id: () => Promise<InputTypeDefID>;
2132
+ /**
2133
+ * Static fields defined on this input object, if any.
2134
+ */
2135
+ fields: () => Promise<FieldTypeDef[]>;
2136
+ /**
2137
+ * The name of the input object.
2138
+ */
2139
+ name: () => Promise<string>;
2140
+ }
1869
2141
  /**
1870
2142
  * A definition of a custom interface defined in a Module.
1871
2143
  */
@@ -1885,9 +2157,21 @@ export declare class InterfaceTypeDef extends BaseClient {
1885
2157
  * A unique identifier for this InterfaceTypeDef.
1886
2158
  */
1887
2159
  id: () => Promise<InterfaceTypeDefID>;
2160
+ /**
2161
+ * The doc string for the interface, if any.
2162
+ */
1888
2163
  description: () => Promise<string>;
2164
+ /**
2165
+ * Functions defined on this interface, if any.
2166
+ */
1889
2167
  functions: () => Promise<Function_[]>;
2168
+ /**
2169
+ * The name of the interface.
2170
+ */
1890
2171
  name: () => Promise<string>;
2172
+ /**
2173
+ * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
2174
+ */
1891
2175
  sourceModuleName: () => Promise<string>;
1892
2176
  }
1893
2177
  /**
@@ -1908,7 +2192,13 @@ export declare class Label extends BaseClient {
1908
2192
  * A unique identifier for this Label.
1909
2193
  */
1910
2194
  id: () => Promise<LabelID>;
2195
+ /**
2196
+ * The label name.
2197
+ */
1911
2198
  name: () => Promise<string>;
2199
+ /**
2200
+ * The label value.
2201
+ */
1912
2202
  value: () => Promise<string>;
1913
2203
  }
1914
2204
  /**
@@ -1927,8 +2217,37 @@ export declare class ListTypeDef extends BaseClient {
1927
2217
  * A unique identifier for this ListTypeDef.
1928
2218
  */
1929
2219
  id: () => Promise<ListTypeDefID>;
2220
+ /**
2221
+ * The type of the elements in the list.
2222
+ */
1930
2223
  elementTypeDef: () => TypeDef;
1931
2224
  }
2225
+ /**
2226
+ * Module source that that originates from a path locally relative to an arbitrary directory.
2227
+ */
2228
+ export declare class LocalModuleSource extends BaseClient {
2229
+ private readonly _id?;
2230
+ private readonly _rootSubpath?;
2231
+ /**
2232
+ * Constructor is used for internal usage only, do not create object from it.
2233
+ */
2234
+ constructor(parent?: {
2235
+ queryTree?: QueryTree[];
2236
+ ctx: Context;
2237
+ }, _id?: LocalModuleSourceID, _rootSubpath?: string);
2238
+ /**
2239
+ * A unique identifier for this LocalModuleSource.
2240
+ */
2241
+ id: () => Promise<LocalModuleSourceID>;
2242
+ /**
2243
+ * The directory containing everything needed to load load and use the module.
2244
+ */
2245
+ contextDirectory: () => Directory;
2246
+ /**
2247
+ * 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).
2248
+ */
2249
+ rootSubpath: () => Promise<string>;
2250
+ }
1932
2251
  /**
1933
2252
  * A Dagger module.
1934
2253
  */
@@ -1938,29 +2257,60 @@ export declare class Module_ extends BaseClient {
1938
2257
  private readonly _name?;
1939
2258
  private readonly _sdk?;
1940
2259
  private readonly _serve?;
1941
- private readonly _sourceDirectorySubpath?;
1942
2260
  /**
1943
2261
  * Constructor is used for internal usage only, do not create object from it.
1944
2262
  */
1945
2263
  constructor(parent?: {
1946
2264
  queryTree?: QueryTree[];
1947
2265
  ctx: Context;
1948
- }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void, _sourceDirectorySubpath?: string);
2266
+ }, _id?: ModuleID, _description?: string, _name?: string, _sdk?: string, _serve?: Void);
1949
2267
  /**
1950
2268
  * A unique identifier for this Module.
1951
2269
  */
1952
2270
  id: () => Promise<ModuleID>;
2271
+ /**
2272
+ * Modules used by this module.
2273
+ */
1953
2274
  dependencies: () => Promise<Module_[]>;
1954
- dependencyConfig: () => Promise<string[]>;
2275
+ /**
2276
+ * The dependencies as configured by the module.
2277
+ */
2278
+ dependencyConfig: () => Promise<ModuleDependency[]>;
2279
+ /**
2280
+ * The doc string of the module, if any
2281
+ */
1955
2282
  description: () => Promise<string>;
1956
- generatedCode: () => GeneratedCode;
2283
+ /**
2284
+ * The generated files and directories made on top of the module source's context directory.
2285
+ */
2286
+ generatedContextDiff: () => Directory;
2287
+ /**
2288
+ * The module source's context plus any configuration and source files created by codegen.
2289
+ */
2290
+ generatedContextDirectory: () => Directory;
1957
2291
  /**
1958
2292
  * Retrieves the module with the objects loaded via its SDK.
1959
2293
  */
1960
2294
  initialize: () => Module_;
2295
+ /**
2296
+ * Interfaces served by this module.
2297
+ */
1961
2298
  interfaces: () => Promise<TypeDef[]>;
2299
+ /**
2300
+ * The name of the module
2301
+ */
1962
2302
  name: () => Promise<string>;
2303
+ /**
2304
+ * Objects served by this module.
2305
+ */
1963
2306
  objects: () => Promise<TypeDef[]>;
2307
+ /**
2308
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
2309
+ */
2310
+ runtime: () => Container;
2311
+ /**
2312
+ * 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.
2313
+ */
1964
2314
  sdk: () => Promise<string>;
1965
2315
  /**
1966
2316
  * Serve a module's API in the current session.
@@ -1968,8 +2318,15 @@ export declare class Module_ extends BaseClient {
1968
2318
  * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
1969
2319
  */
1970
2320
  serve: () => Promise<Void>;
1971
- sourceDirectory: () => Directory;
1972
- sourceDirectorySubpath: () => Promise<string>;
2321
+ /**
2322
+ * The source for the module.
2323
+ */
2324
+ source: () => ModuleSource;
2325
+ /**
2326
+ * Retrieves the module with the given description
2327
+ * @param description The description to set
2328
+ */
2329
+ withDescription: (description: string) => Module_;
1973
2330
  /**
1974
2331
  * This module plus the given Interface type and associated functions
1975
2332
  */
@@ -1979,15 +2336,10 @@ export declare class Module_ extends BaseClient {
1979
2336
  */
1980
2337
  withObject: (object: TypeDef) => Module_;
1981
2338
  /**
1982
- * Retrieves the module with basic configuration loaded, ready for initialization.
1983
- * @param directory The directory containing the module's source code.
1984
- * @param opts.subpath An optional subpath of the directory which contains the module's source code.
1985
- *
1986
- * 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.
1987
- *
1988
- * If not set, the module source code is loaded from the root of the directory.
2339
+ * Retrieves the module with basic configuration loaded if present.
2340
+ * @param source The module source to initialize from.
1989
2341
  */
1990
- withSource: (directory: Directory, opts?: ModuleWithSourceOpts) => Module_;
2342
+ withSource: (source: ModuleSource) => Module_;
1991
2343
  /**
1992
2344
  * Call the provided function with current Module.
1993
2345
  *
@@ -1996,30 +2348,152 @@ export declare class Module_ extends BaseClient {
1996
2348
  with: (arg: (param: Module_) => Module_) => Module_;
1997
2349
  }
1998
2350
  /**
1999
- * Static configuration for a module (e.g. parsed contents of dagger.json)
2351
+ * The configuration of dependency of a module.
2000
2352
  */
2001
- export declare class ModuleConfig extends BaseClient {
2353
+ export declare class ModuleDependency extends BaseClient {
2002
2354
  private readonly _id?;
2003
2355
  private readonly _name?;
2004
- private readonly _root?;
2005
- private readonly _sdk?;
2006
2356
  /**
2007
2357
  * Constructor is used for internal usage only, do not create object from it.
2008
2358
  */
2009
2359
  constructor(parent?: {
2010
2360
  queryTree?: QueryTree[];
2011
2361
  ctx: Context;
2012
- }, _id?: ModuleConfigID, _name?: string, _root?: string, _sdk?: string);
2362
+ }, _id?: ModuleDependencyID, _name?: string);
2363
+ /**
2364
+ * A unique identifier for this ModuleDependency.
2365
+ */
2366
+ id: () => Promise<ModuleDependencyID>;
2013
2367
  /**
2014
- * A unique identifier for this ModuleConfig.
2368
+ * The name of the dependency module.
2015
2369
  */
2016
- id: () => Promise<ModuleConfigID>;
2017
- dependencies: () => Promise<string[]>;
2018
- exclude: () => Promise<string[]>;
2019
- include: () => Promise<string[]>;
2020
2370
  name: () => Promise<string>;
2021
- root: () => Promise<string>;
2022
- sdk: () => Promise<string>;
2371
+ /**
2372
+ * The source for the dependency module.
2373
+ */
2374
+ source: () => ModuleSource;
2375
+ }
2376
+ /**
2377
+ * The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.
2378
+ */
2379
+ export declare class ModuleSource extends BaseClient {
2380
+ private readonly _id?;
2381
+ private readonly _asString?;
2382
+ private readonly _configExists?;
2383
+ private readonly _kind?;
2384
+ private readonly _moduleName?;
2385
+ private readonly _moduleOriginalName?;
2386
+ private readonly _resolveContextPathFromCaller?;
2387
+ private readonly _sourceRootSubpath?;
2388
+ private readonly _sourceSubpath?;
2389
+ /**
2390
+ * Constructor is used for internal usage only, do not create object from it.
2391
+ */
2392
+ constructor(parent?: {
2393
+ queryTree?: QueryTree[];
2394
+ ctx: Context;
2395
+ }, _id?: ModuleSourceID, _asString?: string, _configExists?: boolean, _kind?: ModuleSourceKind, _moduleName?: string, _moduleOriginalName?: string, _resolveContextPathFromCaller?: string, _sourceRootSubpath?: string, _sourceSubpath?: string);
2396
+ /**
2397
+ * A unique identifier for this ModuleSource.
2398
+ */
2399
+ id: () => Promise<ModuleSourceID>;
2400
+ /**
2401
+ * If the source is a of kind git, the git source representation of it.
2402
+ */
2403
+ asGitSource: () => GitModuleSource;
2404
+ /**
2405
+ * If the source is of kind local, the local source representation of it.
2406
+ */
2407
+ asLocalSource: () => LocalModuleSource;
2408
+ /**
2409
+ * Load the source as a module. If this is a local source, the parent directory must have been provided during module source creation
2410
+ */
2411
+ asModule: () => Module_;
2412
+ /**
2413
+ * A human readable ref string representation of this module source.
2414
+ */
2415
+ asString: () => Promise<string>;
2416
+ /**
2417
+ * Returns whether the module source has a configuration file.
2418
+ */
2419
+ configExists: () => Promise<boolean>;
2420
+ /**
2421
+ * The directory containing everything needed to load load and use the module.
2422
+ */
2423
+ contextDirectory: () => Directory;
2424
+ /**
2425
+ * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
2426
+ */
2427
+ dependencies: () => Promise<ModuleDependency[]>;
2428
+ /**
2429
+ * The directory containing the module configuration and source code (source code may be in a subdir).
2430
+ * @param path The path from the source directory to select.
2431
+ */
2432
+ directory: (path: string) => Directory;
2433
+ /**
2434
+ * The kind of source (e.g. local, git, etc.)
2435
+ */
2436
+ kind: () => Promise<ModuleSourceKind>;
2437
+ /**
2438
+ * If set, the name of the module this source references, including any overrides at runtime by callers.
2439
+ */
2440
+ moduleName: () => Promise<string>;
2441
+ /**
2442
+ * The original name of the module this source references, as defined in the module configuration.
2443
+ */
2444
+ moduleOriginalName: () => Promise<string>;
2445
+ /**
2446
+ * The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
2447
+ */
2448
+ resolveContextPathFromCaller: () => Promise<string>;
2449
+ /**
2450
+ * Resolve the provided module source arg as a dependency relative to this module source.
2451
+ * @param dep The dependency module source to resolve.
2452
+ */
2453
+ resolveDependency: (dep: ModuleSource) => ModuleSource;
2454
+ /**
2455
+ * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
2456
+ */
2457
+ resolveFromCaller: () => ModuleSource;
2458
+ /**
2459
+ * 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.
2460
+ */
2461
+ sourceRootSubpath: () => Promise<string>;
2462
+ /**
2463
+ * The path relative to context of the module implementation source code.
2464
+ */
2465
+ sourceSubpath: () => Promise<string>;
2466
+ /**
2467
+ * Update the module source with a new context directory. Only valid for local sources.
2468
+ * @param dir The directory to set as the context directory.
2469
+ */
2470
+ withContextDirectory: (dir: Directory) => ModuleSource;
2471
+ /**
2472
+ * Append the provided dependencies to the module source's dependency list.
2473
+ * @param dependencies The dependencies to append.
2474
+ */
2475
+ withDependencies: (dependencies: ModuleDependency[]) => ModuleSource;
2476
+ /**
2477
+ * Update the module source with a new name.
2478
+ * @param name The name to set.
2479
+ */
2480
+ withName: (name: string) => ModuleSource;
2481
+ /**
2482
+ * Update the module source with a new SDK.
2483
+ * @param sdk The SDK to set.
2484
+ */
2485
+ withSDK: (sdk: string) => ModuleSource;
2486
+ /**
2487
+ * Update the module source with a new source subpath.
2488
+ * @param path The path to set as the source subpath.
2489
+ */
2490
+ withSourceSubpath: (path: string) => ModuleSource;
2491
+ /**
2492
+ * Call the provided function with current ModuleSource.
2493
+ *
2494
+ * This is useful for reusability and readability by not breaking the calling chain.
2495
+ */
2496
+ with: (arg: (param: ModuleSource) => ModuleSource) => ModuleSource;
2023
2497
  }
2024
2498
  /**
2025
2499
  * A definition of a custom object defined in a Module.
@@ -2040,11 +2514,29 @@ export declare class ObjectTypeDef extends BaseClient {
2040
2514
  * A unique identifier for this ObjectTypeDef.
2041
2515
  */
2042
2516
  id: () => Promise<ObjectTypeDefID>;
2517
+ /**
2518
+ * The function used to construct new instances of this object, if any
2519
+ */
2043
2520
  constructor_: () => Function_;
2521
+ /**
2522
+ * The doc string for the object, if any.
2523
+ */
2044
2524
  description: () => Promise<string>;
2525
+ /**
2526
+ * Static fields defined on this object, if any.
2527
+ */
2045
2528
  fields: () => Promise<FieldTypeDef[]>;
2529
+ /**
2530
+ * Functions defined on this object, if any.
2531
+ */
2046
2532
  functions: () => Promise<Function_[]>;
2533
+ /**
2534
+ * The name of the object.
2535
+ */
2047
2536
  name: () => Promise<string>;
2537
+ /**
2538
+ * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
2539
+ */
2048
2540
  sourceModuleName: () => Promise<string>;
2049
2541
  }
2050
2542
  /**
@@ -2053,6 +2545,7 @@ export declare class ObjectTypeDef extends BaseClient {
2053
2545
  export declare class Port extends BaseClient {
2054
2546
  private readonly _id?;
2055
2547
  private readonly _description?;
2548
+ private readonly _experimentalSkipHealthcheck?;
2056
2549
  private readonly _port?;
2057
2550
  private readonly _protocol?;
2058
2551
  /**
@@ -2061,13 +2554,26 @@ export declare class Port extends BaseClient {
2061
2554
  constructor(parent?: {
2062
2555
  queryTree?: QueryTree[];
2063
2556
  ctx: Context;
2064
- }, _id?: PortID, _description?: string, _port?: number, _protocol?: NetworkProtocol);
2557
+ }, _id?: PortID, _description?: string, _experimentalSkipHealthcheck?: boolean, _port?: number, _protocol?: NetworkProtocol);
2065
2558
  /**
2066
2559
  * A unique identifier for this Port.
2067
2560
  */
2068
2561
  id: () => Promise<PortID>;
2562
+ /**
2563
+ * The port description.
2564
+ */
2069
2565
  description: () => Promise<string>;
2566
+ /**
2567
+ * Skip the health check when run as a service.
2568
+ */
2569
+ experimentalSkipHealthcheck: () => Promise<boolean>;
2570
+ /**
2571
+ * The port number.
2572
+ */
2070
2573
  port: () => Promise<number>;
2574
+ /**
2575
+ * The transport layer protocol.
2576
+ */
2071
2577
  protocol: () => Promise<NetworkProtocol>;
2072
2578
  }
2073
2579
  /**
@@ -2118,7 +2624,7 @@ export declare class Client extends BaseClient {
2118
2624
  /**
2119
2625
  * The module currently being served in the session, if any.
2120
2626
  */
2121
- currentModule: () => Module_;
2627
+ currentModule: () => CurrentModule;
2122
2628
  /**
2123
2629
  * The TypeDef representations of the objects currently being served in the session.
2124
2630
  */
@@ -2177,6 +2683,10 @@ export declare class Client extends BaseClient {
2177
2683
  * Load a Container from its ID.
2178
2684
  */
2179
2685
  loadContainerFromID: (id: ContainerID) => Container;
2686
+ /**
2687
+ * Load a CurrentModule from its ID.
2688
+ */
2689
+ loadCurrentModuleFromID: (id: CurrentModuleID) => CurrentModule;
2180
2690
  /**
2181
2691
  * Load a Directory from its ID.
2182
2692
  */
@@ -2213,6 +2723,10 @@ export declare class Client extends BaseClient {
2213
2723
  * Load a GeneratedCode from its ID.
2214
2724
  */
2215
2725
  loadGeneratedCodeFromID: (id: GeneratedCodeID) => GeneratedCode;
2726
+ /**
2727
+ * Load a GitModuleSource from its ID.
2728
+ */
2729
+ loadGitModuleSourceFromID: (id: GitModuleSourceID) => GitModuleSource;
2216
2730
  /**
2217
2731
  * Load a GitRef from its ID.
2218
2732
  */
@@ -2225,6 +2739,10 @@ export declare class Client extends BaseClient {
2225
2739
  * Load a Host from its ID.
2226
2740
  */
2227
2741
  loadHostFromID: (id: HostID) => Host;
2742
+ /**
2743
+ * Load a InputTypeDef from its ID.
2744
+ */
2745
+ loadInputTypeDefFromID: (id: InputTypeDefID) => InputTypeDef;
2228
2746
  /**
2229
2747
  * Load a InterfaceTypeDef from its ID.
2230
2748
  */
@@ -2238,13 +2756,21 @@ export declare class Client extends BaseClient {
2238
2756
  */
2239
2757
  loadListTypeDefFromID: (id: ListTypeDefID) => ListTypeDef;
2240
2758
  /**
2241
- * Load a ModuleConfig from its ID.
2759
+ * Load a LocalModuleSource from its ID.
2242
2760
  */
2243
- loadModuleConfigFromID: (id: ModuleConfigID) => ModuleConfig;
2761
+ loadLocalModuleSourceFromID: (id: LocalModuleSourceID) => LocalModuleSource;
2762
+ /**
2763
+ * Load a ModuleDependency from its ID.
2764
+ */
2765
+ loadModuleDependencyFromID: (id: ModuleDependencyID) => ModuleDependency;
2244
2766
  /**
2245
2767
  * Load a Module from its ID.
2246
2768
  */
2247
2769
  loadModuleFromID: (id: ModuleID) => Module_;
2770
+ /**
2771
+ * Load a ModuleSource from its ID.
2772
+ */
2773
+ loadModuleSourceFromID: (id: ModuleSourceID) => ModuleSource;
2248
2774
  /**
2249
2775
  * Load a ObjectTypeDef from its ID.
2250
2776
  */
@@ -2265,6 +2791,10 @@ export declare class Client extends BaseClient {
2265
2791
  * Load a Socket from its ID.
2266
2792
  */
2267
2793
  loadSocketFromID: (id: SocketID) => Socket;
2794
+ /**
2795
+ * Load a Terminal from its ID.
2796
+ */
2797
+ loadTerminalFromID: (id: TerminalID) => Terminal;
2268
2798
  /**
2269
2799
  * Load a TypeDef from its ID.
2270
2800
  */
@@ -2274,9 +2804,17 @@ export declare class Client extends BaseClient {
2274
2804
  */
2275
2805
  module_: () => Module_;
2276
2806
  /**
2277
- * Load the static configuration for a module from the given source directory and optional subpath.
2807
+ * Create a new module dependency configuration from a module source and name
2808
+ * @param source The source of the dependency
2809
+ * @param opts.name If set, the name to use for the dependency. Otherwise, once installed to a parent module, the name of the dependency module will be used by default.
2278
2810
  */
2279
- moduleConfig: (sourceDirectory: Directory, opts?: ClientModuleConfigOpts) => ModuleConfig;
2811
+ moduleDependency: (source: ModuleSource, opts?: ClientModuleDependencyOpts) => ModuleDependency;
2812
+ /**
2813
+ * Create a new module source instance from a source ref string.
2814
+ * @param refString The string ref representation of the module source
2815
+ * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
2816
+ */
2817
+ moduleSource: (refString: string, opts?: ClientModuleSourceOpts) => ModuleSource;
2280
2818
  /**
2281
2819
  * Creates a named sub-pipeline.
2282
2820
  * @param name Name of the sub-pipeline.
@@ -2343,13 +2881,14 @@ export declare class Service extends BaseClient {
2343
2881
  private readonly _hostname?;
2344
2882
  private readonly _start?;
2345
2883
  private readonly _stop?;
2884
+ private readonly _up?;
2346
2885
  /**
2347
2886
  * Constructor is used for internal usage only, do not create object from it.
2348
2887
  */
2349
2888
  constructor(parent?: {
2350
2889
  queryTree?: QueryTree[];
2351
2890
  ctx: Context;
2352
- }, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID);
2891
+ }, _id?: ServiceID, _endpoint?: string, _hostname?: string, _start?: ServiceID, _stop?: ServiceID, _up?: Void);
2353
2892
  /**
2354
2893
  * A unique identifier for this Service.
2355
2894
  */
@@ -2380,8 +2919,17 @@ export declare class Service extends BaseClient {
2380
2919
  start: () => Promise<Service>;
2381
2920
  /**
2382
2921
  * Stop the service.
2922
+ * @param opts.kill Immediately kill the service without waiting for a graceful exit
2383
2923
  */
2384
- stop: () => Promise<Service>;
2924
+ stop: (opts?: ServiceStopOpts) => Promise<Service>;
2925
+ /**
2926
+ * Creates a tunnel that forwards traffic from the caller's network to this service.
2927
+ * @param opts.ports List of frontend/backend port mappings to forward.
2928
+ *
2929
+ * Frontend is the port accepting traffic on the host, backend is the service port.
2930
+ * @param opts.random Bind each tunnel port to a random port on the host.
2931
+ */
2932
+ up: (opts?: ServiceUpOpts) => Promise<Void>;
2385
2933
  }
2386
2934
  /**
2387
2935
  * A Unix or TCP/IP socket that can be mounted into a container.
@@ -2400,6 +2948,28 @@ export declare class Socket extends BaseClient {
2400
2948
  */
2401
2949
  id: () => Promise<SocketID>;
2402
2950
  }
2951
+ /**
2952
+ * An interactive terminal that clients can connect to.
2953
+ */
2954
+ export declare class Terminal extends BaseClient {
2955
+ private readonly _id?;
2956
+ private readonly _websocketEndpoint?;
2957
+ /**
2958
+ * Constructor is used for internal usage only, do not create object from it.
2959
+ */
2960
+ constructor(parent?: {
2961
+ queryTree?: QueryTree[];
2962
+ ctx: Context;
2963
+ }, _id?: TerminalID, _websocketEndpoint?: string);
2964
+ /**
2965
+ * A unique identifier for this Terminal.
2966
+ */
2967
+ id: () => Promise<TerminalID>;
2968
+ /**
2969
+ * An http endpoint at which this terminal can be connected to over a websocket.
2970
+ */
2971
+ websocketEndpoint: () => Promise<string>;
2972
+ }
2403
2973
  /**
2404
2974
  * A definition of a parameter or return type in a Module.
2405
2975
  */
@@ -2418,10 +2988,29 @@ export declare class TypeDef extends BaseClient {
2418
2988
  * A unique identifier for this TypeDef.
2419
2989
  */
2420
2990
  id: () => Promise<TypeDefID>;
2991
+ /**
2992
+ * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
2993
+ */
2994
+ asInput: () => InputTypeDef;
2995
+ /**
2996
+ * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
2997
+ */
2421
2998
  asInterface: () => InterfaceTypeDef;
2999
+ /**
3000
+ * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
3001
+ */
2422
3002
  asList: () => ListTypeDef;
3003
+ /**
3004
+ * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
3005
+ */
2423
3006
  asObject: () => ObjectTypeDef;
3007
+ /**
3008
+ * The kind of type this is (e.g. primitive, list, object).
3009
+ */
2424
3010
  kind: () => Promise<TypeDefKind>;
3011
+ /**
3012
+ * Whether this type can be set to null. Defaults to false.
3013
+ */
2425
3014
  optional: () => Promise<boolean>;
2426
3015
  /**
2427
3016
  * Adds a function for constructing a new instance of an Object TypeDef, failing if the type is not an object.