@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.
@@ -126,6 +126,12 @@ export type ContainerBuildOpts = {
126
126
  * 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))
127
127
  */
128
128
  secrets?: Secret[];
129
+ /**
130
+ * If set, skip the automatic init process injected into containers created by RUN statements.
131
+ *
132
+ * 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.
133
+ */
134
+ noInit?: boolean;
129
135
  };
130
136
  export type ContainerDirectoryOpts = {
131
137
  /**
@@ -185,7 +191,7 @@ export type ContainerPublishOpts = {
185
191
  /**
186
192
  * Use the specified media types for the published image's layers.
187
193
  *
188
- * Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
194
+ * Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
189
195
  */
190
196
  mediaTypes?: ImageMediaTypes;
191
197
  };
@@ -283,7 +289,7 @@ export type ContainerWithDirectoryOpts = {
283
289
  };
284
290
  export type ContainerWithEntrypointOpts = {
285
291
  /**
286
- * Don't remove the default arguments when setting the entrypoint.
292
+ * Don't reset the default arguments when setting the entrypoint. By default it is reset, since entrypoint and default args are often tightly coupled.
287
293
  */
288
294
  keepDefaultArgs?: boolean;
289
295
  };
@@ -295,19 +301,19 @@ export type ContainerWithEnvVariableOpts = {
295
301
  };
296
302
  export type ContainerWithExecOpts = {
297
303
  /**
298
- * If the container has an entrypoint, prepend it to the args.
304
+ * Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
299
305
  */
300
306
  useEntrypoint?: boolean;
301
307
  /**
302
- * Content to write to the command's standard input before closing (e.g., "Hello world").
308
+ * Content to write to the command's standard input. Example: "Hello world")
303
309
  */
304
310
  stdin?: string;
305
311
  /**
306
- * Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
312
+ * Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
307
313
  */
308
314
  redirectStdout?: string;
309
315
  /**
310
- * Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
316
+ * Like redirectStdout, but for standard error
311
317
  */
312
318
  redirectStderr?: string;
313
319
  /**
@@ -316,12 +322,12 @@ export type ContainerWithExecOpts = {
316
322
  expect?: ReturnType;
317
323
  /**
318
324
  * Provides Dagger access to the executed command.
319
- *
320
- * 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.
321
325
  */
322
326
  experimentalPrivilegedNesting?: boolean;
323
327
  /**
324
- * 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.
328
+ * Execute the command with all root capabilities. Like --privileged in Docker
329
+ *
330
+ * 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.
325
331
  */
326
332
  insecureRootCapabilities?: boolean;
327
333
  /**
@@ -329,19 +335,19 @@ export type ContainerWithExecOpts = {
329
335
  */
330
336
  expand?: boolean;
331
337
  /**
332
- * If set, skip the automatic init process injected into containers by default.
338
+ * Skip the automatic init process injected into containers by default.
333
339
  *
334
- * 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.
340
+ * 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.
335
341
  */
336
342
  noInit?: boolean;
337
343
  };
338
344
  export type ContainerWithExposedPortOpts = {
339
345
  /**
340
- * Transport layer network protocol
346
+ * Network protocol. Example: "tcp"
341
347
  */
342
348
  protocol?: NetworkProtocol;
343
349
  /**
344
- * Optional port description
350
+ * Port description. Example: "payment API endpoint"
345
351
  */
346
352
  description?: string;
347
353
  /**
@@ -351,7 +357,7 @@ export type ContainerWithExposedPortOpts = {
351
357
  };
352
358
  export type ContainerWithFileOpts = {
353
359
  /**
354
- * Permission given to the copied file (e.g., 0600).
360
+ * Permissions of the new file. Example: 0600
355
361
  */
356
362
  permissions?: number;
357
363
  /**
@@ -469,7 +475,7 @@ export type ContainerWithMountedTempOpts = {
469
475
  };
470
476
  export type ContainerWithNewFileOpts = {
471
477
  /**
472
- * Permission given to the written file (e.g., 0600).
478
+ * Permissions of the new file. Example: 0600
473
479
  */
474
480
  permissions?: number;
475
481
  /**
@@ -608,6 +614,12 @@ export type DirectoryDockerBuildOpts = {
608
614
  * They will be mounted at /run/secrets/[secret-name].
609
615
  */
610
616
  secrets?: Secret[];
617
+ /**
618
+ * If set, skip the automatic init process injected into containers created by RUN statements.
619
+ *
620
+ * 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.
621
+ */
622
+ noInit?: boolean;
611
623
  };
612
624
  export type DirectoryEntriesOpts = {
613
625
  /**
@@ -623,11 +635,11 @@ export type DirectoryExportOpts = {
623
635
  };
624
636
  export type DirectoryFilterOpts = {
625
637
  /**
626
- * Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
638
+ * If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
627
639
  */
628
640
  exclude?: string[];
629
641
  /**
630
- * Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
642
+ * If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
631
643
  */
632
644
  include?: string[];
633
645
  };
@@ -681,7 +693,7 @@ export type DirectoryWithNewDirectoryOpts = {
681
693
  };
682
694
  export type DirectoryWithNewFileOpts = {
683
695
  /**
684
- * Permission given to the copied file (e.g., 0600).
696
+ * Permissions of the new file. Example: 0600
685
697
  */
686
698
  permissions?: number;
687
699
  };
@@ -1045,10 +1057,16 @@ export type ClientCacheVolumeOpts = {
1045
1057
  };
1046
1058
  export type ClientContainerOpts = {
1047
1059
  /**
1048
- * Platform to initialize the container with.
1060
+ * Platform to initialize the container with. Defaults to the native platform of the current engine
1049
1061
  */
1050
1062
  platform?: Platform;
1051
1063
  };
1064
+ export type ClientEnvOpts = {
1065
+ /**
1066
+ * Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
1067
+ */
1068
+ privileged?: boolean;
1069
+ };
1052
1070
  export type ClientGitOpts = {
1053
1071
  /**
1054
1072
  * DEPRECATED: Set to true to keep .git directory.
@@ -1083,9 +1101,6 @@ export type ClientLlmOpts = {
1083
1101
  */
1084
1102
  maxAPICalls?: number;
1085
1103
  };
1086
- export type ClientLoadSecretFromNameOpts = {
1087
- accessor?: string;
1088
- };
1089
1104
  export type ClientModuleSourceOpts = {
1090
1105
  /**
1091
1106
  * The pinned version of the module source
@@ -1452,7 +1467,7 @@ export declare class Container extends BaseClient {
1452
1467
  */
1453
1468
  asService: (opts?: ContainerAsServiceOpts) => Service;
1454
1469
  /**
1455
- * Returns a File representing the container serialized to a tarball.
1470
+ * Package the container state as an OCI image, and return it as a tar archive
1456
1471
  * @param opts.platformVariants Identifiers for other platform specific containers.
1457
1472
  *
1458
1473
  * Used for multi-platform images.
@@ -1475,14 +1490,17 @@ export declare class Container extends BaseClient {
1475
1490
  * They will be mounted at /run/secrets/[secret-name] in the build container
1476
1491
  *
1477
1492
  * 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))
1493
+ * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
1494
+ *
1495
+ * 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.
1478
1496
  */
1479
1497
  build: (context: Directory, opts?: ContainerBuildOpts) => Container;
1480
1498
  /**
1481
- * Retrieves default arguments for future commands.
1499
+ * Return the container's default arguments.
1482
1500
  */
1483
1501
  defaultArgs: () => Promise<string[]>;
1484
1502
  /**
1485
- * Retrieves a directory at the given path.
1503
+ * Retrieve a directory from the container's root filesystem
1486
1504
  *
1487
1505
  * Mounts are included.
1488
1506
  * @param path The path of the directory to retrieve (e.g., "./src").
@@ -1490,7 +1508,7 @@ export declare class Container extends BaseClient {
1490
1508
  */
1491
1509
  directory: (path: string, opts?: ContainerDirectoryOpts) => Directory;
1492
1510
  /**
1493
- * Retrieves entrypoint to be prepended to the arguments of all commands.
1511
+ * Return the container's OCI entrypoint.
1494
1512
  */
1495
1513
  entrypoint: () => Promise<string[]>;
1496
1514
  /**
@@ -1503,9 +1521,9 @@ export declare class Container extends BaseClient {
1503
1521
  */
1504
1522
  envVariables: () => Promise<EnvVariable[]>;
1505
1523
  /**
1506
- * The exit code of the last executed command.
1524
+ * The exit code of the last executed command
1507
1525
  *
1508
- * Returns an error if no command was set.
1526
+ * Returns an error if no command was executed
1509
1527
  */
1510
1528
  exitCode: () => Promise<number>;
1511
1529
  /**
@@ -1559,10 +1577,8 @@ export declare class Container extends BaseClient {
1559
1577
  */
1560
1578
  file: (path: string, opts?: ContainerFileOpts) => File;
1561
1579
  /**
1562
- * Initializes this container from a pulled base image.
1563
- * @param address Image's address from its registry.
1564
- *
1565
- * Formatted as [host]/[user]/[repo]:[tag] (e.g., "docker.io/dagger/dagger:main").
1580
+ * Download a container image, and apply it to the container state. All previous state will be lost.
1581
+ * @param address Address of the container image to download, in standard OCI ref format. Example:"registry.dagger.io/engine:latest"
1566
1582
  */
1567
1583
  from: (address: string) => Container;
1568
1584
  /**
@@ -1593,14 +1609,12 @@ export declare class Container extends BaseClient {
1593
1609
  */
1594
1610
  platform: () => Promise<Platform>;
1595
1611
  /**
1596
- * Publishes this container as a new image to the specified address.
1612
+ * Package the container state as an OCI image, and publish it to a registry
1597
1613
  *
1598
- * Publish returns a fully qualified ref.
1614
+ * Returns the fully qualified address of the published image, with digest
1615
+ * @param address The OCI address to publish to
1599
1616
  *
1600
- * It can also publish platform variants.
1601
- * @param address Registry's address to publish the image to.
1602
- *
1603
- * Formatted as [host]/[user]/[repo]:[tag] (e.g. "docker.io/dagger/dagger:main").
1617
+ * Same format as "docker push". Example: "registry.example.com/user/repo:tag"
1604
1618
  * @param opts.platformVariants Identifiers for other platform specific containers.
1605
1619
  *
1606
1620
  * Used for multi-platform image.
@@ -1609,23 +1623,23 @@ export declare class Container extends BaseClient {
1609
1623
  * 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.
1610
1624
  * @param opts.mediaTypes Use the specified media types for the published image's layers.
1611
1625
  *
1612
- * Defaults to OCI, which is largely compatible with most recent registries, but Docker may be needed for older registries without OCI support.
1626
+ * Defaults to "OCI", which is compatible with most recent registries, but "Docker" may be needed for older registries without OCI support.
1613
1627
  */
1614
1628
  publish: (address: string, opts?: ContainerPublishOpts) => Promise<string>;
1615
1629
  /**
1616
- * Retrieves this container's root filesystem. Mounts are not included.
1630
+ * 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.
1617
1631
  */
1618
1632
  rootfs: () => Directory;
1619
1633
  /**
1620
- * The error stream of the last executed command.
1634
+ * The buffered standard error stream of the last executed command
1621
1635
  *
1622
- * Returns an error if no command was set.
1636
+ * Returns an error if no command was executed
1623
1637
  */
1624
1638
  stderr: () => Promise<string>;
1625
1639
  /**
1626
- * The output stream of the last executed command.
1640
+ * The buffered standard output stream of the last executed command
1627
1641
  *
1628
- * Returns an error if no command was set.
1642
+ * Returns an error if no command was executed
1629
1643
  */
1630
1644
  stdout: () => Promise<string>;
1631
1645
  /**
@@ -1676,7 +1690,7 @@ export declare class Container extends BaseClient {
1676
1690
  */
1677
1691
  withAnnotation: (name: string, value: string) => Container;
1678
1692
  /**
1679
- * Configures default arguments for future commands.
1693
+ * Configures default arguments for future commands. Like CMD in Dockerfile.
1680
1694
  * @param args Arguments to prepend to future executions (e.g., ["-v", "--no-cache"]).
1681
1695
  */
1682
1696
  withDefaultArgs: (args: string[]) => Container;
@@ -1690,7 +1704,7 @@ export declare class Container extends BaseClient {
1690
1704
  */
1691
1705
  withDefaultTerminalCmd: (args: string[], opts?: ContainerWithDefaultTerminalCmdOpts) => Container;
1692
1706
  /**
1693
- * Retrieves this container plus a directory written at the given path.
1707
+ * Return a new container snapshot, with a directory added to its filesystem
1694
1708
  * @param path Location of the written directory (e.g., "/tmp/directory").
1695
1709
  * @param directory Identifier of the directory to write
1696
1710
  * @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
@@ -1704,57 +1718,59 @@ export declare class Container extends BaseClient {
1704
1718
  */
1705
1719
  withDirectory: (path: string, directory: Directory, opts?: ContainerWithDirectoryOpts) => Container;
1706
1720
  /**
1707
- * Retrieves this container but with a different command entrypoint.
1708
- * @param args Entrypoint to use for future executions (e.g., ["go", "run"]).
1709
- * @param opts.keepDefaultArgs Don't remove the default arguments when setting the entrypoint.
1721
+ * Set an OCI-style entrypoint. It will be included in the container's OCI configuration. Note, withExec ignores the entrypoint by default.
1722
+ * @param args Arguments of the entrypoint. Example: ["go", "run"].
1723
+ * @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.
1710
1724
  */
1711
1725
  withEntrypoint: (args: string[], opts?: ContainerWithEntrypointOpts) => Container;
1712
1726
  /**
1713
- * Retrieves this container plus the given environment variable.
1714
- * @param name The name of the environment variable (e.g., "HOST").
1715
- * @param value The value of the environment variable. (e.g., "localhost").
1727
+ * Set a new environment variable in the container.
1728
+ * @param name Name of the environment variable (e.g., "HOST").
1729
+ * @param value Value of the environment variable. (e.g., "localhost").
1716
1730
  * @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").
1717
1731
  */
1718
1732
  withEnvVariable: (name: string, value: string, opts?: ContainerWithEnvVariableOpts) => Container;
1719
1733
  /**
1720
- * Retrieves this container after executing the specified command inside it.
1721
- * @param args Command to run instead of the container's default command (e.g., ["go", "run", "main.go"]).
1734
+ * Execute a command in the container, and return a new snapshot of the container state after execution.
1735
+ * @param args Command to execute. Must be valid exec() arguments, not a shell command. Example: ["go", "run", "main.go"].
1722
1736
  *
1723
- * If empty, the container's default command is used.
1724
- * @param opts.useEntrypoint If the container has an entrypoint, prepend it to the args.
1725
- * @param opts.stdin Content to write to the command's standard input before closing (e.g., "Hello world").
1726
- * @param opts.redirectStdout Redirect the command's standard output to a file in the container (e.g., "/tmp/stdout").
1727
- * @param opts.redirectStderr Redirect the command's standard error to a file in the container (e.g., "/tmp/stderr").
1737
+ * To run a shell command, execute the shell and pass the shell command as argument. Example: ["sh", "-c", "ls -l | grep foo"]
1738
+ *
1739
+ * Defaults to the container's default arguments (see "defaultArgs" and "withDefaultArgs").
1740
+ * @param opts.useEntrypoint Apply the OCI entrypoint, if present, by prepending it to the args. Ignored by default.
1741
+ * @param opts.stdin Content to write to the command's standard input. Example: "Hello world")
1742
+ * @param opts.redirectStdout Redirect the command's standard output to a file in the container. Example: "./stdout.txt"
1743
+ * @param opts.redirectStderr Like redirectStdout, but for standard error
1728
1744
  * @param opts.expect Exit codes this command is allowed to exit with without error
1729
1745
  * @param opts.experimentalPrivilegedNesting Provides Dagger access to the executed command.
1746
+ * @param opts.insecureRootCapabilities Execute the command with all root capabilities. Like --privileged in Docker
1730
1747
  *
1731
- * 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.
1732
- * @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.
1748
+ * 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.
1733
1749
  * @param opts.expand Replace "${VAR}" or "$VAR" in the args according to the current environment variables defined in the container (e.g. "/$VAR/foo").
1734
- * @param opts.noInit If set, skip the automatic init process injected into containers by default.
1750
+ * @param opts.noInit Skip the automatic init process injected into containers by default.
1735
1751
  *
1736
- * 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.
1752
+ * 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.
1737
1753
  */
1738
1754
  withExec: (args: string[], opts?: ContainerWithExecOpts) => Container;
1739
1755
  /**
1740
- * Expose a network port.
1756
+ * Expose a network port. Like EXPOSE in Dockerfile (but with healthcheck support)
1741
1757
  *
1742
1758
  * Exposed ports serve two purposes:
1743
1759
  *
1744
1760
  * - For health checks and introspection, when running services
1745
1761
  *
1746
1762
  * - For setting the EXPOSE OCI field when publishing the container
1747
- * @param port Port number to expose
1748
- * @param opts.protocol Transport layer network protocol
1749
- * @param opts.description Optional port description
1763
+ * @param port Port number to expose. Example: 8080
1764
+ * @param opts.protocol Network protocol. Example: "tcp"
1765
+ * @param opts.description Port description. Example: "payment API endpoint"
1750
1766
  * @param opts.experimentalSkipHealthcheck Skip the health check when run as a service.
1751
1767
  */
1752
1768
  withExposedPort: (port: number, opts?: ContainerWithExposedPortOpts) => Container;
1753
1769
  /**
1754
- * Retrieves this container plus the contents of the given file copied to the given path.
1755
- * @param path Location of the copied file (e.g., "/tmp/file.txt").
1756
- * @param source Identifier of the file to copy.
1757
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
1770
+ * Return a container snapshot with a file added
1771
+ * @param path Path of the new file. Example: "/path/to/new-file.txt"
1772
+ * @param source File to add
1773
+ * @param opts.permissions Permissions of the new file. Example: 0600
1758
1774
  * @param opts.owner A user:group to set for the file.
1759
1775
  *
1760
1776
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -1845,10 +1861,10 @@ export declare class Container extends BaseClient {
1845
1861
  */
1846
1862
  withMountedTemp: (path: string, opts?: ContainerWithMountedTempOpts) => Container;
1847
1863
  /**
1848
- * Retrieves this container plus a new file written at the given path.
1849
- * @param path Location of the written file (e.g., "/tmp/file.txt").
1850
- * @param contents Content of the file to write (e.g., "Hello world!").
1851
- * @param opts.permissions Permission given to the written file (e.g., 0600).
1864
+ * Return a new container snapshot, with a file added to its filesystem
1865
+ * @param path Path of the new file. May be relative or absolute. Example: "README.md" or "/etc/profile"
1866
+ * @param contents Contents of the new file. Example: "Hello world!"
1867
+ * @param opts.permissions Permissions of the new file. Example: 0600
1852
1868
  * @param opts.owner A user:group to set for the file.
1853
1869
  *
1854
1870
  * The user and group can either be an ID (1000:1000) or a name (foo:bar).
@@ -1858,35 +1874,33 @@ export declare class Container extends BaseClient {
1858
1874
  */
1859
1875
  withNewFile: (path: string, contents: string, opts?: ContainerWithNewFileOpts) => Container;
1860
1876
  /**
1861
- * Retrieves this container with a registry authentication for a given address.
1862
- * @param address Registry's address to bind the authentication to.
1863
- *
1864
- * Formatted as [host]/[user]/[repo]:[tag] (e.g. docker.io/dagger/dagger:main).
1865
- * @param username The username of the registry's account (e.g., "Dagger").
1866
- * @param secret The API key, password or token to authenticate to this registry.
1877
+ * Attach credentials for future publishing to a registry. Use in combination with publish
1878
+ * @param address The image address that needs authentication. Same format as "docker push". Example: "registry.dagger.io/dagger:latest"
1879
+ * @param username The username to authenticate with. Example: "alice"
1880
+ * @param secret The API key, password or token to authenticate to this registry
1867
1881
  */
1868
1882
  withRegistryAuth: (address: string, username: string, secret: Secret) => Container;
1869
1883
  /**
1870
- * Retrieves the container with the given directory mounted to /.
1871
- * @param directory Directory to mount.
1884
+ * Change the container's root filesystem. The previous root filesystem will be lost.
1885
+ * @param directory The new root filesystem.
1872
1886
  */
1873
1887
  withRootfs: (directory: Directory) => Container;
1874
1888
  /**
1875
- * Retrieves this container plus an env variable containing the given secret.
1876
- * @param name The name of the secret variable (e.g., "API_SECRET").
1877
- * @param secret The identifier of the secret value.
1889
+ * Set a new environment variable, using a secret value
1890
+ * @param name Name of the secret variable (e.g., "API_SECRET").
1891
+ * @param secret Identifier of the secret value.
1878
1892
  */
1879
1893
  withSecretVariable: (name: string, secret: Secret) => Container;
1880
1894
  /**
1881
- * Establish a runtime dependency on a service.
1895
+ * Establish a runtime dependency on a from a container to a network service.
1882
1896
  *
1883
1897
  * The service will be started automatically when needed and detached when it is no longer needed, executing the default command if none is set.
1884
1898
  *
1885
1899
  * The service will be reachable from the container via the provided hostname alias.
1886
1900
  *
1887
1901
  * The service dependency will also convey to any files or directories produced by the container.
1888
- * @param alias A name that can be used to reach the service from the container
1889
- * @param service Identifier of the service container
1902
+ * @param alias Hostname that will resolve to the target service (only accessible from within this container)
1903
+ * @param service The target service
1890
1904
  */
1891
1905
  withServiceBinding: (alias: string, service: Service) => Container;
1892
1906
  /**
@@ -1907,7 +1921,7 @@ export declare class Container extends BaseClient {
1907
1921
  */
1908
1922
  withUser: (name: string) => Container;
1909
1923
  /**
1910
- * Retrieves this container with a different working directory.
1924
+ * Change the container's working directory. Like WORKDIR in Dockerfile.
1911
1925
  * @param path The path to set as the working directory (e.g., "/app").
1912
1926
  * @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").
1913
1927
  */
@@ -1918,17 +1932,17 @@ export declare class Container extends BaseClient {
1918
1932
  */
1919
1933
  withoutAnnotation: (name: string) => Container;
1920
1934
  /**
1921
- * Retrieves this container with unset default arguments for future commands.
1935
+ * Remove the container's default arguments.
1922
1936
  */
1923
1937
  withoutDefaultArgs: () => Container;
1924
1938
  /**
1925
- * Retrieves this container with the directory at the given path removed.
1939
+ * Return a new container snapshot, with a directory removed from its filesystem
1926
1940
  * @param path Location of the directory to remove (e.g., ".github/").
1927
1941
  * @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").
1928
1942
  */
1929
1943
  withoutDirectory: (path: string, opts?: ContainerWithoutDirectoryOpts) => Container;
1930
1944
  /**
1931
- * Retrieves this container with an unset command entrypoint.
1945
+ * Reset the container's OCI entrypoint.
1932
1946
  * @param opts.keepDefaultArgs Don't remove the default arguments when unsetting the entrypoint.
1933
1947
  */
1934
1948
  withoutEntrypoint: (opts?: ContainerWithoutEntrypointOpts) => Container;
@@ -1950,8 +1964,8 @@ export declare class Container extends BaseClient {
1950
1964
  */
1951
1965
  withoutFile: (path: string, opts?: ContainerWithoutFileOpts) => Container;
1952
1966
  /**
1953
- * Retrieves this container with the files at the given paths removed.
1954
- * @param paths Location of the files to remove (e.g., ["/file.txt"]).
1967
+ * Return a new container spanshot with specified files removed
1968
+ * @param paths Paths of the files to remove. Example: ["foo.txt, "/root/.ssh/config"
1955
1969
  * @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").
1956
1970
  */
1957
1971
  withoutFiles: (paths: string[], opts?: ContainerWithoutFilesOpts) => Container;
@@ -1991,7 +2005,7 @@ export declare class Container extends BaseClient {
1991
2005
  */
1992
2006
  withoutUser: () => Container;
1993
2007
  /**
1994
- * Retrieves this container with an unset working directory.
2008
+ * Unset the container's working directory.
1995
2009
  *
1996
2010
  * Should default to "/".
1997
2011
  */
@@ -2060,7 +2074,7 @@ export declare class Directory extends BaseClient {
2060
2074
  */
2061
2075
  id: () => Promise<DirectoryID>;
2062
2076
  /**
2063
- * Converts this directory into a git repository
2077
+ * Converts this directory to a local git repository
2064
2078
  */
2065
2079
  asGit: () => GitRepository;
2066
2080
  /**
@@ -2078,8 +2092,8 @@ export declare class Directory extends BaseClient {
2078
2092
  */
2079
2093
  asModuleSource: (opts?: DirectoryAsModuleSourceOpts) => ModuleSource;
2080
2094
  /**
2081
- * Gets the difference between this directory and an another directory.
2082
- * @param other Identifier of the directory to compare.
2095
+ * Return the difference between this directory and an another directory. The difference is encoded as a directory.
2096
+ * @param other The directory to compare against
2083
2097
  */
2084
2098
  diff: (other: Directory) => Directory;
2085
2099
  /**
@@ -2088,11 +2102,11 @@ export declare class Directory extends BaseClient {
2088
2102
  digest: () => Promise<string>;
2089
2103
  /**
2090
2104
  * Retrieves a directory at the given path.
2091
- * @param path Location of the directory to retrieve (e.g., "/src").
2105
+ * @param path Location of the directory to retrieve. Example: "/src"
2092
2106
  */
2093
2107
  directory: (path: string) => Directory;
2094
2108
  /**
2095
- * Builds a new Docker container from this directory.
2109
+ * 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.
2096
2110
  * @param opts.platform The platform to build.
2097
2111
  * @param opts.dockerfile Path to the Dockerfile to use (e.g., "frontend.Dockerfile").
2098
2112
  * @param opts.target Target build stage to build.
@@ -2100,6 +2114,9 @@ export declare class Directory extends BaseClient {
2100
2114
  * @param opts.secrets Secrets to pass to the build.
2101
2115
  *
2102
2116
  * They will be mounted at /run/secrets/[secret-name].
2117
+ * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
2118
+ *
2119
+ * 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.
2103
2120
  */
2104
2121
  dockerBuild: (opts?: DirectoryDockerBuildOpts) => Container;
2105
2122
  /**
@@ -2114,14 +2131,14 @@ export declare class Directory extends BaseClient {
2114
2131
  */
2115
2132
  export: (path: string, opts?: DirectoryExportOpts) => Promise<string>;
2116
2133
  /**
2117
- * Retrieves a file at the given path.
2134
+ * Retrieve a file at the given path.
2118
2135
  * @param path Location of the file to retrieve (e.g., "README.md").
2119
2136
  */
2120
2137
  file: (path: string) => File;
2121
2138
  /**
2122
- * Retrieves this directory as per exclude/include filters.
2123
- * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2124
- * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
2139
+ * Return a snapshot with some paths included or excluded
2140
+ * @param opts.exclude If set, paths matching one of these glob patterns is excluded from the new snapshot. Example: ["node_modules/", ".git*", ".env"]
2141
+ * @param opts.include If set, only paths matching one of these glob patterns is included in the new snapshot. Example: (e.g., ["app/", "package.*"]).
2125
2142
  */
2126
2143
  filter: (opts?: DirectoryFilterOpts) => Directory;
2127
2144
  /**
@@ -2148,7 +2165,7 @@ export declare class Directory extends BaseClient {
2148
2165
  */
2149
2166
  terminal: (opts?: DirectoryTerminalOpts) => Directory;
2150
2167
  /**
2151
- * Retrieves this directory plus a directory written at the given path.
2168
+ * Return a snapshot with a directory added
2152
2169
  * @param path Location of the written directory (e.g., "/src/").
2153
2170
  * @param directory Identifier of the directory to copy.
2154
2171
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
@@ -2176,10 +2193,10 @@ export declare class Directory extends BaseClient {
2176
2193
  */
2177
2194
  withNewDirectory: (path: string, opts?: DirectoryWithNewDirectoryOpts) => Directory;
2178
2195
  /**
2179
- * Retrieves this directory plus a new file written at the given path.
2180
- * @param path Location of the written file (e.g., "/file.txt").
2181
- * @param contents Content of the written file (e.g., "Hello world!").
2182
- * @param opts.permissions Permission given to the copied file (e.g., 0600).
2196
+ * Return a snapshot with a new file added
2197
+ * @param path Path of the new file. Example: "foo/bar.txt"
2198
+ * @param contents Contents of the new file. Example: "Hello world!"
2199
+ * @param opts.permissions Permissions of the new file. Example: 0600
2183
2200
  */
2184
2201
  withNewFile: (path: string, contents: string, opts?: DirectoryWithNewFileOpts) => Directory;
2185
2202
  /**
@@ -2190,18 +2207,18 @@ export declare class Directory extends BaseClient {
2190
2207
  */
2191
2208
  withTimestamps: (timestamp: number) => Directory;
2192
2209
  /**
2193
- * Retrieves this directory with the directory at the given path removed.
2194
- * @param path Location of the directory to remove (e.g., ".github/").
2210
+ * Return a snapshot with a subdirectory removed
2211
+ * @param path Path of the subdirectory to remove. Example: ".github/workflows"
2195
2212
  */
2196
2213
  withoutDirectory: (path: string) => Directory;
2197
2214
  /**
2198
- * Retrieves this directory with the file at the given path removed.
2199
- * @param path Location of the file to remove (e.g., "/file.txt").
2215
+ * Return a snapshot with a file removed
2216
+ * @param path Path of the file to remove (e.g., "/file.txt").
2200
2217
  */
2201
2218
  withoutFile: (path: string) => Directory;
2202
2219
  /**
2203
- * Retrieves this directory with the files at the given paths removed.
2204
- * @param paths Location of the file to remove (e.g., ["/file.txt"]).
2220
+ * Return a snapshot with files removed
2221
+ * @param paths Paths of the files to remove (e.g., ["/file.txt"]).
2205
2222
  */
2206
2223
  withoutFiles: (paths: string[]) => Directory;
2207
2224
  /**
@@ -3144,6 +3161,7 @@ export declare class Host extends BaseClient {
3144
3161
  * The file is limited to a size of 512000 bytes.
3145
3162
  * @param name The user defined name for this secret.
3146
3163
  * @param path Location of the file to set as a secret.
3164
+ * @deprecated setSecretFile is superceded by use of the secret API with file:// URIs
3147
3165
  */
3148
3166
  setSecretFile: (name: string, path: string) => Secret;
3149
3167
  /**
@@ -3313,10 +3331,6 @@ export declare class LLM extends BaseClient {
3313
3331
  * @param file The file to read the prompt from
3314
3332
  */
3315
3333
  withPromptFile: (file: File) => LLM;
3316
- /**
3317
- * Provide the entire Query object to the LLM
3318
- */
3319
- withQuery: () => LLM;
3320
3334
  /**
3321
3335
  * Add a system prompt to the LLM's environment
3322
3336
  * @param prompt The system prompt to send
@@ -3798,10 +3812,10 @@ export declare class Client extends BaseClient {
3798
3812
  */
3799
3813
  cacheVolume: (key: string, opts?: ClientCacheVolumeOpts) => CacheVolume;
3800
3814
  /**
3801
- * Creates a scratch container.
3815
+ * Creates a scratch container, with no image or metadata.
3802
3816
  *
3803
- * Optional platform argument initializes new containers to execute and publish as that platform. Platform defaults to that of the builder's host.
3804
- * @param opts.platform Platform to initialize the container with.
3817
+ * To pull an image, follow up with the "from" function.
3818
+ * @param opts.platform Platform to initialize the container with. Defaults to the native platform of the current engine
3805
3819
  */
3806
3820
  container: (opts?: ClientContainerOpts) => Container;
3807
3821
  /**
@@ -3832,8 +3846,9 @@ export declare class Client extends BaseClient {
3832
3846
  engine: () => Engine;
3833
3847
  /**
3834
3848
  * Initialize a new environment
3849
+ * @param opts.privileged Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
3835
3850
  */
3836
- env: () => Env;
3851
+ env: (opts?: ClientEnvOpts) => Env;
3837
3852
  /**
3838
3853
  * Create a new error.
3839
3854
  * @param message A brief description of the error.
@@ -4034,10 +4049,6 @@ export declare class Client extends BaseClient {
4034
4049
  * Load a Secret from its ID.
4035
4050
  */
4036
4051
  loadSecretFromID: (id: SecretID) => Secret;
4037
- /**
4038
- * Load a Secret from its Name.
4039
- */
4040
- loadSecretFromName: (name: string, opts?: ClientLoadSecretFromNameOpts) => Secret;
4041
4052
  /**
4042
4053
  * Load a Service from its ID.
4043
4054
  */