@dagger.io/dagger 0.18.1 → 0.18.3

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.
@@ -396,7 +396,7 @@ export class Container extends BaseClient {
396
396
  return new Service(ctx);
397
397
  };
398
398
  /**
399
- * Returns a File representing the container serialized to a tarball.
399
+ * Package the container state as an OCI image, and return it as a tar archive
400
400
  * @param opts.platformVariants Identifiers for other platform specific containers.
401
401
  *
402
402
  * Used for multi-platform images.
@@ -426,13 +426,16 @@ export class Container extends BaseClient {
426
426
  * They will be mounted at /run/secrets/[secret-name] in the build container
427
427
  *
428
428
  * They can be accessed in the Dockerfile using the "secret" mount type and mount path /run/secrets/[secret-name], e.g. RUN --mount=type=secret,id=my-secret curl [http://example.com?token=$(cat /run/secrets/my-secret)](http://example.com?token=$(cat /run/secrets/my-secret))
429
+ * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
430
+ *
431
+ * This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
429
432
  */
430
433
  build = (context, opts) => {
431
434
  const ctx = this._ctx.select("build", { context, ...opts });
432
435
  return new Container(ctx);
433
436
  };
434
437
  /**
435
- * Retrieves default arguments for future commands.
438
+ * Return the container's default arguments.
436
439
  */
437
440
  defaultArgs = async () => {
438
441
  const ctx = this._ctx.select("defaultArgs");
@@ -440,7 +443,7 @@ export class Container extends BaseClient {
440
443
  return response;
441
444
  };
442
445
  /**
443
- * Retrieves a directory at the given path.
446
+ * Retrieve a directory from the container's root filesystem
444
447
  *
445
448
  * Mounts are included.
446
449
  * @param path The path of the directory to retrieve (e.g., "./src").
@@ -451,7 +454,7 @@ export class Container extends BaseClient {
451
454
  return new Directory(ctx);
452
455
  };
453
456
  /**
454
- * Retrieves entrypoint to be prepended to the arguments of all commands.
457
+ * Return the container's OCI entrypoint.
455
458
  */
456
459
  entrypoint = async () => {
457
460
  const ctx = this._ctx.select("entrypoint");
@@ -479,9 +482,9 @@ export class Container extends BaseClient {
479
482
  return response.map((r) => new Client(ctx.copy()).loadEnvVariableFromID(r.id));
480
483
  };
481
484
  /**
482
- * The exit code of the last executed command.
485
+ * The exit code of the last executed command
483
486
  *
484
- * Returns an error if no command was set.
487
+ * Returns an error if no command was executed
485
488
  */
486
489
  exitCode = async () => {
487
490
  if (this._exitCode) {
@@ -570,10 +573,8 @@ export class Container extends BaseClient {
570
573
  return new File(ctx);
571
574
  };
572
575
  /**
573
- * Initializes this container from a pulled base image.
574
- * @param address Image's address from its registry.
575
- *
576
- * Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
576
+ * Download a container image, and apply it to the container state. All previous state will be lost.
577
+ * @param address Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
577
578
  */
578
579
  from = (address) => {
579
580
  const ctx = this._ctx.select("from", { address });
@@ -639,14 +640,12 @@ export class Container extends BaseClient {
639
640
  return response;
640
641
  };
641
642
  /**
642
- * Publishes this container as a new image to the specified address.
643
+ * Package the container state as an OCI image, and publish it to a registry
643
644
  *
644
- * Publish returns a fully qualified ref.
645
+ * Returns the fully qualified address of the published image, with digest
646
+ * @param address The OCI address to publish to
645
647
  *
646
- * It can also publish platform variants.
647
- * @param address Registry's address to publish the image to.
648
- *
649
- * Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
648
+ * Same format as "docker push". Example: "registry.example.com/user/repo:tag"
650
649
  * @param opts.platformVariants Identifiers for other platform specific containers.
651
650
  *
652
651
  * Used for multi-platform image.
@@ -655,7 +654,7 @@ export class Container extends BaseClient {
655
654
  * If this is unset, then if a layer already has a compressed blob in the engine's cache, that will be used (this can result in a mix of compression algorithms for different layers). If this is unset and a layer has no compressed blob in the engine's cache, then it will be compressed using Gzip.
656
655
  * @param opts.mediaTypes Use the specified media types for the published image's layers.
657
656
  *
658
- * Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
657
+ * Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
659
658
  */
660
659
  publish = async (address, opts) => {
661
660
  if (this._publish) {
@@ -674,16 +673,16 @@ export class Container extends BaseClient {
674
673
  return response;
675
674
  };
676
675
  /**
677
- * Retrieves this container's root filesystem. Mounts are not included.
676
+ * Return a snapshot of the container's root filesystem. The snapshot can be modified then written back using withRootfs. Use that method for filesystem modifications.
678
677
  */
679
678
  rootfs = () => {
680
679
  const ctx = this._ctx.select("rootfs");
681
680
  return new Directory(ctx);
682
681
  };
683
682
  /**
684
- * The error stream of the last executed command.
683
+ * The buffered standard error stream of the last executed command
685
684
  *
686
- * Returns an error if no command was set.
685
+ * Returns an error if no command was executed
687
686
  */
688
687
  stderr = async () => {
689
688
  if (this._stderr) {
@@ -694,9 +693,9 @@ export class Container extends BaseClient {
694
693
  return response;
695
694
  };
696
695
  /**
697
- * The output stream of the last executed command.
696
+ * The buffered standard output stream of the last executed command
698
697
  *
699
- * Returns an error if no command was set.
698
+ * Returns an error if no command was executed
700
699
  */
701
700
  stdout = async () => {
702
701
  if (this._stdout) {
@@ -777,7 +776,7 @@ export class Container extends BaseClient {
777
776
  return new Container(ctx);
778
777
  };
779
778
  /**
780
- * Configures default arguments for future commands.
779
+ * Configures default arguments for future commands. Like CMD in Dockerfile.
781
780
  * @param args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
782
781
  */
783
782
  withDefaultArgs = (args) => {
@@ -797,7 +796,7 @@ export class Container extends BaseClient {
797
796
  return new Container(ctx);
798
797
  };
799
798
  /**
800
- * Retrieves this container plus a directory written at the given path.
799
+ * Return a new container snapshot, with a directory added to its filesystem
801
800
  * @param path Location of the written directory (e.g., "/tmp/directory").
802
801
  * @param directory Identifier of the directory to write
803
802
  * @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
@@ -814,18 +813,18 @@ export class Container extends BaseClient {
814
813
  return new Container(ctx);
815
814
  };
816
815
  /**
817
- * Retrieves this container but with a different command entrypoint.
818
- * @param args Entrypoint to use for future executions (e.g., ["go", "run"]).
819
- * @param opts.keepDefaultArgs Don't remove the default arguments when setting the entrypoint.
816
+ * Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
817
+ * @param args Arguments of the entrypoint. Example: ["go", "run"].
818
+ * @param opts.keepDefaultArgs Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
820
819
  */
821
820
  withEntrypoint = (args, opts) => {
822
821
  const ctx = this._ctx.select("withEntrypoint", { args, ...opts });
823
822
  return new Container(ctx);
824
823
  };
825
824
  /**
826
- * Retrieves this container plus the given environment variable.
827
- * @param name The name of the environment variable (e.g., "HOST").
828
- * @param value The value of the environment variable. (e.g., "localhost").
825
+ * Set a new environment variable in the container.
826
+ * @param name Name of the environment variable (e.g., "HOST").
827
+ * @param value Value of the environment variable. (e.g., "localhost").
829
828
  * @param opts.expand Replace "${VAR}" or "$VAR" in the value according to the current environment variables defined in the container (e.g. "/opt/bin:$PATH").
830
829
  */
831
830
  withEnvVariable = (name, value, opts) => {
@@ -833,23 +832,25 @@ export class Container extends BaseClient {
833
832
  return new Container(ctx);
834
833
  };
835
834
  /**
836
- * Retrieves this container after executing the specified command inside it.
837
- * @param args Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
835
+ * Execute a command in the container, and return a new snapshot of the container state after execution.
836
+ * @param args Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
838
837
  *
839
- * If empty, the container's default command is used.
840
- * @param opts.useEntrypoint If the container has an entrypoint, prepend it to the args.
841
- * @param opts.stdin Content to write to the command's standard input before closing (e.g., "Hello world").
842
- * @param opts.redirectStdout Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
843
- * @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
838
+ * To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
839
+ *
840
+ * Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
841
+ * @param opts.useEntrypoint Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
842
+ * @param opts.stdin Content to write to the command's standard input. Example: "Hello world")
843
+ * @param opts.redirectStdout Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
844
+ * @param opts.redirectStderr Like redirectStdout, but for standard error
844
845
  * @param opts.expect Exit codes this command is allowed to exit with without error
845
846
  * @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
847
+ * @param opts.insecureRootCapabilities Execute the command with all root capabilities. Like --privileged in Docker
846
848
  *
847
- * Do not use this option unless you trust the command being executed; the command being executed WILL BE GRANTED FULL ACCESS TO YOUR HOST FILESYSTEM.
848
- * @param opts.insecureRootCapabilities Execute the command with all root capabilities. This is similar to running a command with "sudo" or executing "docker run" with the "--privileged" flag. Containerization does not provide any security guarantees when using this option. It should only be used when absolutely necessary and only with trusted commands.
849
+ * DANGER: this grants the command full access to the host system. Only use when 1) you trust the command being executed and 2) you specifically need this level of access.
849
850
  * @param opts.expand Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
850
- * @param opts.noInit If set, skip the automatic init process injected into containers by default.
851
+ * @param opts.noInit Skip the automatic init process injected into containers by default.
851
852
  *
852
- * This should only be used if the user requires that their exec process be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
853
+ * Only use this if you specifically need the command to be pid 1 in the container. Otherwise it may result in unexpected behavior. If you're not sure, you don't need this.
853
854
  */
854
855
  withExec = (args, opts) => {
855
856
  const metadata = {
@@ -863,16 +864,16 @@ export class Container extends BaseClient {
863
864
  return new Container(ctx);
864
865
  };
865
866
  /**
866
- * Expose a network port.
867
+ * Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
867
868
  *
868
869
  * Exposed ports serve two purposes:
869
870
  *
870
871
  * - For health checks and introspection, when running services
871
872
  *
872
873
  * - For setting the EXPOSE OCI field when publishing the container
873
- * @param port Port number to expose
874
- * @param opts.protocol Transport layer network protocol
875
- * @param opts.description Optional port description
874
+ * @param port Port number to expose. Example: 8080
875
+ * @param opts.protocol Network protocol. Example: "tcp"
876
+ * @param opts.description Port description. Example: "payment API endpoint"
876
877
  * @param opts.experimentalSkipHealthcheck Skip the health check when run as a service.
877
878
  */
878
879
  withExposedPort = (port, opts) => {
@@ -887,10 +888,10 @@ export class Container extends BaseClient {
887
888
  return new Container(ctx);
888
889
  };
889
890
  /**
890
- * Retrieves this container plus the contents of the given file copied to the given path.
891
- * @param path Location of the copied file (e.g., "/tmp/file.txt").
892
- * @param source Identifier of the file to copy.
893
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
891
+ * Return a container snapshot with a file added
892
+ * @param path Path of the new file. Example: "/path/to/new-file.txt"
893
+ * @param source File to add
894
+ * @param opts.permissions Permissions of the new file. Example: 0600
894
895
  * @param opts.owner A user:group to set for the file.
895
896
  *
896
897
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -1017,10 +1018,10 @@ export class Container extends BaseClient {
1017
1018
  return new Container(ctx);
1018
1019
  };
1019
1020
  /**
1020
- * Retrieves this container plus a new file written at the given path.
1021
- * @param path Location of the written file (e.g., "/tmp/file.txt").
1022
- * @param contents Content of the file to write (e.g., "Hello world!").
1023
- * @param opts.permissions Permission given to the written file (e.g., 0600).
1021
+ * Return a new container snapshot, with a file added to its filesystem
1022
+ * @param path Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
1023
+ * @param contents Contents of the new file. Example: "Hello world!"
1024
+ * @param opts.permissions Permissions of the new file. Example: 0600
1024
1025
  * @param opts.owner A user:group to set for the file.
1025
1026
  *
1026
1027
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -1033,12 +1034,10 @@ export class Container extends BaseClient {
1033
1034
  return new Container(ctx);
1034
1035
  };
1035
1036
  /**
1036
- * Retrieves this container with a registry authentication for a given address.
1037
- * @param address Registry's address to bind the authentication to.
1038
- *
1039
- * Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
1040
- * @param username The username of the registry's account (e.g., "Dagger").
1041
- * @param secret The API key, password or token to authenticate to this registry.
1037
+ * Attach credentials for future publishing to a registry. Use in combination with publish
1038
+ * @param address The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
1039
+ * @param username The username to authenticate with. Example: "alice"
1040
+ * @param secret The API key, password or token to authenticate to this registry
1042
1041
  */
1043
1042
  withRegistryAuth = (address, username, secret) => {
1044
1043
  const ctx = this._ctx.select("withRegistryAuth", {
@@ -1049,32 +1048,32 @@ export class Container extends BaseClient {
1049
1048
  return new Container(ctx);
1050
1049
  };
1051
1050
  /**
1052
- * Retrieves the container with the given directory mounted to /.
1053
- * @param directory Directory to mount.
1051
+ * Change the container's root filesystem. The previous root filesystem will be lost.
1052
+ * @param directory The new root filesystem.
1054
1053
  */
1055
1054
  withRootfs = (directory) => {
1056
1055
  const ctx = this._ctx.select("withRootfs", { directory });
1057
1056
  return new Container(ctx);
1058
1057
  };
1059
1058
  /**
1060
- * Retrieves this container plus an env variable containing the given secret.
1061
- * @param name The name of the secret variable (e.g., "API_SECRET").
1062
- * @param secret The identifier of the secret value.
1059
+ * Set a new environment variable, using a secret value
1060
+ * @param name Name of the secret variable (e.g., "API_SECRET").
1061
+ * @param secret Identifier of the secret value.
1063
1062
  */
1064
1063
  withSecretVariable = (name, secret) => {
1065
1064
  const ctx = this._ctx.select("withSecretVariable", { name, secret });
1066
1065
  return new Container(ctx);
1067
1066
  };
1068
1067
  /**
1069
- * Establish a runtime dependency on a service.
1068
+ * Establish a runtime dependency on a from a container to a network service.
1070
1069
  *
1071
1070
  * The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
1072
1071
  *
1073
1072
  * The service will be reachable from the container via the provided hostname alias.
1074
1073
  *
1075
1074
  * The service dependency will also convey to any files or directories produced by the container.
1076
- * @param alias A name that can be used to reach the service from the container
1077
- * @param service Identifier of the service container
1075
+ * @param alias Hostname that will resolve to the target service (only accessible from within this container)
1076
+ * @param service The target service
1078
1077
  */
1079
1078
  withServiceBinding = (alias, service) => {
1080
1079
  const ctx = this._ctx.select("withServiceBinding", { alias, service });
@@ -1104,7 +1103,7 @@ export class Container extends BaseClient {
1104
1103
  return new Container(ctx);
1105
1104
  };
1106
1105
  /**
1107
- * Retrieves this container with a different working directory.
1106
+ * Change the container's working directory. Like WORKDIR in Dockerfile.
1108
1107
  * @param path The path to set as the working directory (e.g., "/app").
1109
1108
  * @param opts.expand Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1110
1109
  */
@@ -1121,14 +1120,14 @@ export class Container extends BaseClient {
1121
1120
  return new Container(ctx);
1122
1121
  };
1123
1122
  /**
1124
- * Retrieves this container with unset default arguments for future commands.
1123
+ * Remove the container's default arguments.
1125
1124
  */
1126
1125
  withoutDefaultArgs = () => {
1127
1126
  const ctx = this._ctx.select("withoutDefaultArgs");
1128
1127
  return new Container(ctx);
1129
1128
  };
1130
1129
  /**
1131
- * Retrieves this container with the directory at the given path removed.
1130
+ * Return a new container snapshot, with a directory removed from its filesystem
1132
1131
  * @param path Location of the directory to remove (e.g., ".github/").
1133
1132
  * @param opts.expand Replace "${VAR}" or "$VAR" in the value of path according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1134
1133
  */
@@ -1137,7 +1136,7 @@ export class Container extends BaseClient {
1137
1136
  return new Container(ctx);
1138
1137
  };
1139
1138
  /**
1140
- * Retrieves this container with an unset command entrypoint.
1139
+ * Reset the container's OCI entrypoint.
1141
1140
  * @param opts.keepDefaultArgs Don't remove the default arguments when unsetting the entrypoint.
1142
1141
  */
1143
1142
  withoutEntrypoint = (opts) => {
@@ -1178,8 +1177,8 @@ export class Container extends BaseClient {
1178
1177
  return new Container(ctx);
1179
1178
  };
1180
1179
  /**
1181
- * Retrieves this container with the files at the given paths removed.
1182
- * @param paths Location of the files to remove (e.g., ["/file.txt"]).
1180
+ * Return a new container spanshot with specified files removed
1181
+ * @param paths Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
1183
1182
  * @param opts.expand Replace "${VAR}" or "$VAR" in the value of paths according to the current environment variables defined in the container (e.g. "/$VAR/foo.txt").
1184
1183
  */
1185
1184
  withoutFiles = (paths, opts) => {
@@ -1240,7 +1239,7 @@ export class Container extends BaseClient {
1240
1239
  return new Container(ctx);
1241
1240
  };
1242
1241
  /**
1243
- * Retrieves this container with an unset working directory.
1242
+ * Unset the container's working directory.
1244
1243
  *
1245
1244
  * Should default to "/".
1246
1245
  */
@@ -1362,7 +1361,7 @@ export class Directory extends BaseClient {
1362
1361
  return response;
1363
1362
  };
1364
1363
  /**
1365
- * Converts this directory into a git repository
1364
+ * Converts this directory to a local git repository
1366
1365
  */
1367
1366
  asGit = () => {
1368
1367
  const ctx = this._ctx.select("asGit");
@@ -1389,8 +1388,8 @@ export class Directory extends BaseClient {
1389
1388
  return new ModuleSource(ctx);
1390
1389
  };
1391
1390
  /**
1392
- * Gets the difference between this directory and an another directory.
1393
- * @param other Identifier of the directory to compare.
1391
+ * Return the difference between this directory and an another directory. The difference is encoded as a directory.
1392
+ * @param other The directory to compare against
1394
1393
  */
1395
1394
  diff = (other) => {
1396
1395
  const ctx = this._ctx.select("diff", { other });
@@ -1409,14 +1408,14 @@ export class Directory extends BaseClient {
1409
1408
  };
1410
1409
  /**
1411
1410
  * Retrieves a directory at the given path.
1412
- * @param path Location of the directory to retrieve (e.g., "/src").
1411
+ * @param path Location of the directory to retrieve. Example: "/src"
1413
1412
  */
1414
1413
  directory = (path) => {
1415
1414
  const ctx = this._ctx.select("directory", { path });
1416
1415
  return new Directory(ctx);
1417
1416
  };
1418
1417
  /**
1419
- * Builds a new Docker container from this directory.
1418
+ * Use Dockerfile compatibility to build a container from this directory. Only use this function for Dockerfile compatibility. Otherwise use the native Container type directly, it is feature-complete and supports all Dockerfile features.
1420
1419
  * @param opts.platform The platform to build.
1421
1420
  * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
1422
1421
  * @param opts.target Target build stage to build.
@@ -1424,6 +1423,9 @@ export class Directory extends BaseClient {
1424
1423
  * @param opts.secrets Secrets to pass to the build.
1425
1424
  *
1426
1425
  * They will be mounted at /run/secrets/[secret-name].
1426
+ * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
1427
+ *
1428
+ * This should only be used if the user requires that their exec processes be the pid 1 process in the container. Otherwise it may result in unexpected behavior.
1427
1429
  */
1428
1430
  dockerBuild = (opts) => {
1429
1431
  const ctx = this._ctx.select("dockerBuild", { ...opts });
@@ -1452,7 +1454,7 @@ export class Directory extends BaseClient {
1452
1454
  return response;
1453
1455
  };
1454
1456
  /**
1455
- * Retrieves a file at the given path.
1457
+ * Retrieve a file at the given path.
1456
1458
  * @param path Location of the file to retrieve (e.g., "README.md").
1457
1459
  */
1458
1460
  file = (path) => {
@@ -1460,9 +1462,9 @@ export class Directory extends BaseClient {
1460
1462
  return new File(ctx);
1461
1463
  };
1462
1464
  /**
1463
- * Retrieves this directory as per exclude/include filters.
1464
- * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1465
- * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1465
+ * Return a snapshot with some paths included or excluded
1466
+ * @param opts.exclude If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
1467
+ * @param opts.include If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
1466
1468
  */
1467
1469
  filter = (opts) => {
1468
1470
  const ctx = this._ctx.select("filter", { ...opts });
@@ -1510,7 +1512,7 @@ export class Directory extends BaseClient {
1510
1512
  return new Directory(ctx);
1511
1513
  };
1512
1514
  /**
1513
- * Retrieves this directory plus a directory written at the given path.
1515
+ * Return a snapshot with a directory added
1514
1516
  * @param path Location of the written directory (e.g., "/src/").
1515
1517
  * @param directory Identifier of the directory to copy.
1516
1518
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
@@ -1550,10 +1552,10 @@ export class Directory extends BaseClient {
1550
1552
  return new Directory(ctx);
1551
1553
  };
1552
1554
  /**
1553
- * Retrieves this directory plus a new file written at the given path.
1554
- * @param path Location of the written file (e.g., "/file.txt").
1555
- * @param contents Content of the written file (e.g., "Hello world!").
1556
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
1555
+ * Return a snapshot with a new file added
1556
+ * @param path Path of the new file. Example: "foo/bar.txt"
1557
+ * @param contents Contents of the new file. Example: "Hello world!"
1558
+ * @param opts.permissions Permissions of the new file. Example: 0600
1557
1559
  */
1558
1560
  withNewFile = (path, contents, opts) => {
1559
1561
  const ctx = this._ctx.select("withNewFile", { path, contents, ...opts });
@@ -1570,24 +1572,24 @@ export class Directory extends BaseClient {
1570
1572
  return new Directory(ctx);
1571
1573
  };
1572
1574
  /**
1573
- * Retrieves this directory with the directory at the given path removed.
1574
- * @param path Location of the directory to remove (e.g., ".github/").
1575
+ * Return a snapshot with a subdirectory removed
1576
+ * @param path Path of the subdirectory to remove. Example: ".github/workflows"
1575
1577
  */
1576
1578
  withoutDirectory = (path) => {
1577
1579
  const ctx = this._ctx.select("withoutDirectory", { path });
1578
1580
  return new Directory(ctx);
1579
1581
  };
1580
1582
  /**
1581
- * Retrieves this directory with the file at the given path removed.
1582
- * @param path Location of the file to remove (e.g., "/file.txt").
1583
+ * Return a snapshot with a file removed
1584
+ * @param path Path of the file to remove (e.g., "/file.txt").
1583
1585
  */
1584
1586
  withoutFile = (path) => {
1585
1587
  const ctx = this._ctx.select("withoutFile", { path });
1586
1588
  return new Directory(ctx);
1587
1589
  };
1588
1590
  /**
1589
- * Retrieves this directory with the files at the given paths removed.
1590
- * @param paths Location of the file to remove (e.g., ["/file.txt"]).
1591
+ * Return a snapshot with files removed
1592
+ * @param paths Paths of the files to remove (e.g., ["/file.txt"]).
1591
1593
  */
1592
1594
  withoutFiles = (paths) => {
1593
1595
  const ctx = this._ctx.select("withoutFiles", { paths });
@@ -3377,6 +3379,7 @@ export class Host extends BaseClient {
3377
3379
  * The file is limited to a size of 512000 bytes.
3378
3380
  * @param name The user defined name for this secret.
3379
3381
  * @param path Location of the file to set as a secret.
3382
+ * @deprecated setSecretFile is superceded by use of the secret API with file:// URIs
3380
3383
  */
3381
3384
  setSecretFile = (name, path) => {
3382
3385
  const ctx = this._ctx.select("setSecretFile", { name, path });
@@ -3706,13 +3709,6 @@ export class LLM extends BaseClient {
3706
3709
  const ctx = this._ctx.select("withPromptFile", { file });
3707
3710
  return new LLM(ctx);
3708
3711
  };
3709
- /**
3710
- * Provide the entire Query object to the LLM
3711
- */
3712
- withQuery = () => {
3713
- const ctx = this._ctx.select("withQuery");
3714
- return new LLM(ctx);
3715
- };
3716
3712
  /**
3717
3713
  * Add a system prompt to the LLM's environment
3718
3714
  * @param prompt The system prompt to send
@@ -4702,10 +4698,10 @@ export class Client extends BaseClient {
4702
4698
  return new CacheVolume(ctx);
4703
4699
  };
4704
4700
  /**
4705
- * Creates a scratch container.
4701
+ * Creates a scratch container, with no image or metadata.
4706
4702
  *
4707
- * Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
4708
- * @param opts.platform Platform to initialize the container with.
4703
+ * To pull an image, follow up with the "from" function.
4704
+ * @param opts.platform Platform to initialize the container with. Defaults to the native platform of the current engine
4709
4705
  */
4710
4706
  container = (opts) => {
4711
4707
  const ctx = this._ctx.select("container", { ...opts });
@@ -4759,9 +4755,10 @@ export class Client extends BaseClient {
4759
4755
  };
4760
4756
  /**
4761
4757
  * Initialize a new environment
4758
+ * @param opts.privileged Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
4762
4759
  */
4763
- env = () => {
4764
- const ctx = this._ctx.select("env");
4760
+ env = (opts) => {
4761
+ const ctx = this._ctx.select("env", { ...opts });
4765
4762
  return new Env(ctx);
4766
4763
  };
4767
4764
  /**
@@ -5102,13 +5099,6 @@ export class Client extends BaseClient {
5102
5099
  const ctx = this._ctx.select("loadSecretFromID", { id });
5103
5100
  return new Secret(ctx);
5104
5101
  };
5105
- /**
5106
- * Load a Secret from its Name.
5107
- */
5108
- loadSecretFromName = (name, opts) => {
5109
- const ctx = this._ctx.select("loadSecretFromName", { name, ...opts });
5110
- return new Secret(ctx);
5111
- };
5112
5102
  /**
5113
5103
  * Load a Service from its ID.
5114
5104
  */
@@ -20,10 +20,5 @@ export interface ConnectOpts {
20
20
  ```
21
21
  */
22
22
  LogOutput?: Writable;
23
- /**
24
- * Serve the current module in the context directory if available.
25
- * @defaultValue false
26
- */
27
- ServeCurrentModule?: boolean;
28
23
  }
29
24
  //# sourceMappingURL=connectOpts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"connectOpts.d.ts","sourceRoot":"","sources":["../../src/connectOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;;;;;;;SAUK;IACL,SAAS,CAAC,EAAE,QAAQ,CAAA;IAEpB;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B"}
1
+ {"version":3,"file":"connectOpts.d.ts","sourceRoot":"","sources":["../../src/connectOpts.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,CAAC,EAAE,MAAM,CAAA;IAEhB;;;;;;;;;;SAUK;IACL,SAAS,CAAC,EAAE,QAAQ,CAAA;CACrB"}
@@ -1 +1 @@
1
- {"version":3,"file":"bin.d.ts","sourceRoot":"","sources":["../../../src/provisioning/bin.ts"],"names":[],"mappings":"AAGA,OAAO,EAAS,aAAa,EAAE,MAAM,OAAO,CAAA;AAE5C,OAAO,E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AEG;IACH,OAAO,CAAC,cAAc;IAStB;;OAEG;IACH,OAAO,CAAC,YAAY;IASpB,OAAO,CAAC,cAAc;IAWtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,cAAc;YAOR,WAAW;YAkBX,gBAAgB;YAWhB,cAAc;IA4C5B;;OAEG;IACH,OAAO,CAAC,WAAW;CAGpB;AAGD,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAEjD;AAGD,wBAAgB,wBAAwB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE1D"}
@@ -139,9 +139,6 @@ export class Bin {
139
139
  if (opts.LogOutput) {
140
140
  opts.LogOutput.write("Creating new Engine session... ");
141
141
  }
142
- if (opts.ServeCurrentModule) {
143
- args.push("--serve-module");
144
- }
145
142
  this._subProcess = execa(binPath, args, {
146
143
  stdio: "pipe",
147
144
  reject: true,
@@ -1,2 +1,2 @@
1
- export declare const CLI_VERSION = "0.18.1";
1
+ export declare const CLI_VERSION = "0.18.3";
2
2
  //# sourceMappingURL=default.d.ts.map
@@ -1,2 +1,2 @@
1
1
  // Code generated by dagger. DO NOT EDIT.
2
- export const CLI_VERSION = "0.18.1";
2
+ export const CLI_VERSION = "0.18.3";
@@ -5,7 +5,6 @@ export interface ConnectOpts {
5
5
  Project?: string;
6
6
  LogOutput?: Writable;
7
7
  Timeout?: number;
8
- ServeCurrentModule?: boolean;
9
8
  }
10
9
  export interface ConnectParams {
11
10
  port: number;
@@ -1 +1 @@
1
- {"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../../src/provisioning/engineconn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,kBAAkB,CAAC,EAAE,OAAO,CAAA;CAC7B;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,UAAU;IACzB;;;;;;;;;OASG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAEtD;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB"}
1
+ {"version":3,"file":"engineconn.d.ts","sourceRoot":"","sources":["../../../src/provisioning/engineconn.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAC/C,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAEtC,MAAM,WAAW,WAAW;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,SAAS,CAAC,EAAE,QAAQ,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,aAAa;IAC5B,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;CACtB;AAED,MAAM,WAAW,UAAU;IACzB;;;;;;;;;OASG;IACH,OAAO,EAAE,CAAC,IAAI,EAAE,WAAW,KAAK,OAAO,CAAC,aAAa,CAAC,CAAA;IAEtD;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAA;CAClB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dagger.io/dagger",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "author": "hello@dagger.io",
5
5
  "license": "Apache-2.0",
6
6
  "types": "./dist/src/index.d.ts",