@dagger.io/dagger 0.18.18 → 0.19.0

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.
@@ -505,6 +505,99 @@ function TypeDefKindNameToValue(name) {
505
505
  return name;
506
506
  }
507
507
  }
508
+ /**
509
+ * A standardized address to load containers, directories, secrets, and other object types. Address format depends on the type, and is validated at type selection.
510
+ */
511
+ export class Address extends BaseClient {
512
+ _id = undefined;
513
+ _value = undefined;
514
+ /**
515
+ * Constructor is used for internal usage only, do not create object from it.
516
+ */
517
+ constructor(ctx, _id, _value) {
518
+ super(ctx);
519
+ this._id = _id;
520
+ this._value = _value;
521
+ }
522
+ /**
523
+ * A unique identifier for this Address.
524
+ */
525
+ id = async () => {
526
+ if (this._id) {
527
+ return this._id;
528
+ }
529
+ const ctx = this._ctx.select("id");
530
+ const response = await ctx.execute();
531
+ return response;
532
+ };
533
+ /**
534
+ * Load a container from the address.
535
+ */
536
+ container = () => {
537
+ const ctx = this._ctx.select("container");
538
+ return new Container(ctx);
539
+ };
540
+ /**
541
+ * Load a directory from the address.
542
+ */
543
+ directory = (opts) => {
544
+ const ctx = this._ctx.select("directory", { ...opts });
545
+ return new Directory(ctx);
546
+ };
547
+ /**
548
+ * Load a file from the address.
549
+ */
550
+ file = (opts) => {
551
+ const ctx = this._ctx.select("file", { ...opts });
552
+ return new File(ctx);
553
+ };
554
+ /**
555
+ * Load a git ref (branch, tag or commit) from the address.
556
+ */
557
+ gitRef = () => {
558
+ const ctx = this._ctx.select("gitRef");
559
+ return new GitRef(ctx);
560
+ };
561
+ /**
562
+ * Load a git repository from the address.
563
+ */
564
+ gitRepository = () => {
565
+ const ctx = this._ctx.select("gitRepository");
566
+ return new GitRepository(ctx);
567
+ };
568
+ /**
569
+ * Load a secret from the address.
570
+ */
571
+ secret = () => {
572
+ const ctx = this._ctx.select("secret");
573
+ return new Secret(ctx);
574
+ };
575
+ /**
576
+ * Load a service from the address.
577
+ */
578
+ service = () => {
579
+ const ctx = this._ctx.select("service");
580
+ return new Service(ctx);
581
+ };
582
+ /**
583
+ * Load a local socket from the address.
584
+ */
585
+ socket = () => {
586
+ const ctx = this._ctx.select("socket");
587
+ return new Socket(ctx);
588
+ };
589
+ /**
590
+ * The address value
591
+ */
592
+ value = async () => {
593
+ if (this._value) {
594
+ return this._value;
595
+ }
596
+ const ctx = this._ctx.select("value");
597
+ const response = await ctx.execute();
598
+ return response;
599
+ };
600
+ }
508
601
  export class Binding extends BaseClient {
509
602
  _id = undefined;
510
603
  _asString = undefined;
@@ -535,6 +628,13 @@ export class Binding extends BaseClient {
535
628
  const response = await ctx.execute();
536
629
  return response;
537
630
  };
631
+ /**
632
+ * Retrieve the binding value, as type Address
633
+ */
634
+ asAddress = () => {
635
+ const ctx = this._ctx.select("asAddress");
636
+ return new Address(ctx);
637
+ };
538
638
  /**
539
639
  * Retrieve the binding value, as type CacheVolume
540
640
  */
@@ -612,13 +712,6 @@ export class Binding extends BaseClient {
612
712
  const ctx = this._ctx.select("asJSONValue");
613
713
  return new JSONValue(ctx);
614
714
  };
615
- /**
616
- * Retrieve the binding value, as type LLM
617
- */
618
- asLLM = () => {
619
- const ctx = this._ctx.select("asLLM");
620
- return new LLM(ctx);
621
- };
622
715
  /**
623
716
  * Retrieve the binding value, as type Module
624
717
  */
@@ -676,7 +769,7 @@ export class Binding extends BaseClient {
676
769
  return new Socket(ctx);
677
770
  };
678
771
  /**
679
- * The binding's string value
772
+ * Returns the binding's string value
680
773
  */
681
774
  asString = async () => {
682
775
  if (this._asString) {
@@ -687,7 +780,7 @@ export class Binding extends BaseClient {
687
780
  return response;
688
781
  };
689
782
  /**
690
- * The digest of the binding value
783
+ * Returns the digest of the binding value
691
784
  */
692
785
  digest = async () => {
693
786
  if (this._digest) {
@@ -709,7 +802,7 @@ export class Binding extends BaseClient {
709
802
  return response;
710
803
  };
711
804
  /**
712
- * The binding name
805
+ * Returns the binding name
713
806
  */
714
807
  name = async () => {
715
808
  if (this._name) {
@@ -720,7 +813,7 @@ export class Binding extends BaseClient {
720
813
  return response;
721
814
  };
722
815
  /**
723
- * The binding type
816
+ * Returns the binding type
724
817
  */
725
818
  typeName = async () => {
726
819
  if (this._typeName) {
@@ -760,13 +853,15 @@ export class CacheVolume extends BaseClient {
760
853
  */
761
854
  export class Changeset extends BaseClient {
762
855
  _id = undefined;
856
+ _export = undefined;
763
857
  _sync = undefined;
764
858
  /**
765
859
  * Constructor is used for internal usage only, do not create object from it.
766
860
  */
767
- constructor(ctx, _id, _sync) {
861
+ constructor(ctx, _id, _export, _sync) {
768
862
  super(ctx);
769
863
  this._id = _id;
864
+ this._export = _export;
770
865
  this._sync = _sync;
771
866
  }
772
867
  /**
@@ -809,6 +904,18 @@ export class Changeset extends BaseClient {
809
904
  const ctx = this._ctx.select("before");
810
905
  return new Directory(ctx);
811
906
  };
907
+ /**
908
+ * Applies the diff represented by this changeset to a path on the host.
909
+ * @param path Location of the copied directory (e.g., "logs/").
910
+ */
911
+ export = async (path) => {
912
+ if (this._export) {
913
+ return this._export;
914
+ }
915
+ const ctx = this._ctx.select("export", { path });
916
+ const response = await ctx.execute();
917
+ return response;
918
+ };
812
919
  /**
813
920
  * Return a snapshot containing only the created and modified files
814
921
  */
@@ -975,26 +1082,6 @@ export class Container extends BaseClient {
975
1082
  const ctx = this._ctx.select("asTarball", { ...opts, __metadata: metadata });
976
1083
  return new File(ctx);
977
1084
  };
978
- /**
979
- * Initializes this container from a Dockerfile build.
980
- * @param context Directory context used by the Dockerfile.
981
- * @param opts.dockerfile Path to the Dockerfile to use.
982
- * @param opts.target Target build stage to build.
983
- * @param opts.buildArgs Additional build arguments.
984
- * @param opts.secrets Secrets to pass to the build.
985
- *
986
- * They will be mounted at /run/secrets/[secret-name] in the build container
987
- *
988
- * 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))
989
- * @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
990
- *
991
- * 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.
992
- * @deprecated Use `Directory.build` instead
993
- */
994
- build = (context, opts) => {
995
- const ctx = this._ctx.select("build", { context, ...opts });
996
- return new Container(ctx);
997
- };
998
1085
  /**
999
1086
  * The combined buffered standard output and standard error stream of the last executed command
1000
1087
  *
@@ -1424,7 +1511,7 @@ export class Container extends BaseClient {
1424
1511
  /**
1425
1512
  * Return a new container snapshot, with a directory added to its filesystem
1426
1513
  * @param path Location of the written directory (e.g., "/tmp/directory").
1427
- * @param directory Identifier of the directory to write
1514
+ * @param source Identifier of the directory to write
1428
1515
  * @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
1429
1516
  * @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
1430
1517
  * @param opts.owner A user:group to set for the directory and its contents.
@@ -1434,8 +1521,8 @@ export class Container extends BaseClient {
1434
1521
  * If the group is omitted, it defaults to the same as the user.
1435
1522
  * @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").
1436
1523
  */
1437
- withDirectory = (path, directory, opts) => {
1438
- const ctx = this._ctx.select("withDirectory", { path, directory, ...opts });
1524
+ withDirectory = (path, source, opts) => {
1525
+ const ctx = this._ctx.select("withDirectory", { path, source, ...opts });
1439
1526
  return new Container(ctx);
1440
1527
  };
1441
1528
  /**
@@ -2239,7 +2326,7 @@ export class Directory extends BaseClient {
2239
2326
  /**
2240
2327
  * Return a snapshot with a directory added
2241
2328
  * @param path Location of the written directory (e.g., "/src/").
2242
- * @param directory Identifier of the directory to copy.
2329
+ * @param source Identifier of the directory to copy.
2243
2330
  * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2244
2331
  * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
2245
2332
  * @param opts.owner A user:group to set for the copied directory and its contents.
@@ -2248,8 +2335,8 @@ export class Directory extends BaseClient {
2248
2335
  *
2249
2336
  * If the group is omitted, it defaults to the same as the user.
2250
2337
  */
2251
- withDirectory = (path, directory, opts) => {
2252
- const ctx = this._ctx.select("withDirectory", { path, directory, ...opts });
2338
+ withDirectory = (path, source, opts) => {
2339
+ const ctx = this._ctx.select("withDirectory", { path, source, ...opts });
2253
2340
  return new Directory(ctx);
2254
2341
  };
2255
2342
  /**
@@ -2402,7 +2489,6 @@ export class Engine extends BaseClient {
2402
2489
  */
2403
2490
  export class EngineCache extends BaseClient {
2404
2491
  _id = undefined;
2405
- _keepBytes = undefined;
2406
2492
  _maxUsedSpace = undefined;
2407
2493
  _minFreeSpace = undefined;
2408
2494
  _prune = undefined;
@@ -2411,10 +2497,9 @@ export class EngineCache extends BaseClient {
2411
2497
  /**
2412
2498
  * Constructor is used for internal usage only, do not create object from it.
2413
2499
  */
2414
- constructor(ctx, _id, _keepBytes, _maxUsedSpace, _minFreeSpace, _prune, _reservedSpace, _targetSpace) {
2500
+ constructor(ctx, _id, _maxUsedSpace, _minFreeSpace, _prune, _reservedSpace, _targetSpace) {
2415
2501
  super(ctx);
2416
2502
  this._id = _id;
2417
- this._keepBytes = _keepBytes;
2418
2503
  this._maxUsedSpace = _maxUsedSpace;
2419
2504
  this._minFreeSpace = _minFreeSpace;
2420
2505
  this._prune = _prune;
@@ -2439,18 +2524,6 @@ export class EngineCache extends BaseClient {
2439
2524
  const ctx = this._ctx.select("entrySet", { ...opts });
2440
2525
  return new EngineCacheEntrySet(ctx);
2441
2526
  };
2442
- /**
2443
- * The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
2444
- * @deprecated Use minFreeSpace instead.
2445
- */
2446
- keepBytes = async () => {
2447
- if (this._keepBytes) {
2448
- return this._keepBytes;
2449
- }
2450
- const ctx = this._ctx.select("keepBytes");
2451
- const response = await ctx.execute();
2452
- return response;
2453
- };
2454
2527
  /**
2455
2528
  * The maximum bytes to keep in the cache without pruning.
2456
2529
  */
@@ -2831,14 +2904,14 @@ export class Env extends BaseClient {
2831
2904
  return response;
2832
2905
  };
2833
2906
  /**
2834
- * retrieve an input value by name
2907
+ * Retrieves an input binding by name
2835
2908
  */
2836
2909
  input = (name) => {
2837
2910
  const ctx = this._ctx.select("input", { name });
2838
2911
  return new Binding(ctx);
2839
2912
  };
2840
2913
  /**
2841
- * return all input values for the environment
2914
+ * Returns all input bindings provided to the environment
2842
2915
  */
2843
2916
  inputs = async () => {
2844
2917
  const ctx = this._ctx.select("inputs").select("id");
@@ -2846,20 +2919,43 @@ export class Env extends BaseClient {
2846
2919
  return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
2847
2920
  };
2848
2921
  /**
2849
- * retrieve an output value by name
2922
+ * Retrieves an output binding by name
2850
2923
  */
2851
2924
  output = (name) => {
2852
2925
  const ctx = this._ctx.select("output", { name });
2853
2926
  return new Binding(ctx);
2854
2927
  };
2855
2928
  /**
2856
- * return all output values for the environment
2929
+ * Returns all declared output bindings for the environment
2857
2930
  */
2858
2931
  outputs = async () => {
2859
2932
  const ctx = this._ctx.select("outputs").select("id");
2860
2933
  const response = await ctx.execute();
2861
2934
  return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
2862
2935
  };
2936
+ /**
2937
+ * Create or update a binding of type Address in the environment
2938
+ * @param name The name of the binding
2939
+ * @param value The Address value to assign to the binding
2940
+ * @param description The purpose of the input
2941
+ */
2942
+ withAddressInput = (name, value, description) => {
2943
+ const ctx = this._ctx.select("withAddressInput", {
2944
+ name,
2945
+ value,
2946
+ description,
2947
+ });
2948
+ return new Env(ctx);
2949
+ };
2950
+ /**
2951
+ * Declare a desired Address output to be assigned in the environment
2952
+ * @param name The name of the binding
2953
+ * @param description A description of the desired value of the binding
2954
+ */
2955
+ withAddressOutput = (name, description) => {
2956
+ const ctx = this._ctx.select("withAddressOutput", { name, description });
2957
+ return new Env(ctx);
2958
+ };
2863
2959
  /**
2864
2960
  * Create or update a binding of type CacheVolume in the environment
2865
2961
  * @param name The name of the binding
@@ -2948,6 +3044,15 @@ export class Env extends BaseClient {
2948
3044
  const ctx = this._ctx.select("withContainerOutput", { name, description });
2949
3045
  return new Env(ctx);
2950
3046
  };
3047
+ /**
3048
+ * Installs the current module into the environment, exposing its functions to the model
3049
+ *
3050
+ * Contextual path arguments will be populated using the environment's workspace.
3051
+ */
3052
+ withCurrentModule = () => {
3053
+ const ctx = this._ctx.select("withCurrentModule");
3054
+ return new Env(ctx);
3055
+ };
2951
3056
  /**
2952
3057
  * Create or update a binding of type Directory in the environment
2953
3058
  * @param name The name of the binding
@@ -3105,22 +3210,14 @@ export class Env extends BaseClient {
3105
3210
  return new Env(ctx);
3106
3211
  };
3107
3212
  /**
3108
- * Create or update a binding of type LLM in the environment
3109
- * @param name The name of the binding
3110
- * @param value The LLM value to assign to the binding
3111
- * @param description The purpose of the input
3112
- */
3113
- withLLMInput = (name, value, description) => {
3114
- const ctx = this._ctx.select("withLLMInput", { name, value, description });
3115
- return new Env(ctx);
3116
- };
3117
- /**
3118
- * Declare a desired LLM output to be assigned in the environment
3119
- * @param name The name of the binding
3120
- * @param description A description of the desired value of the binding
3213
+ * Installs a module into the environment, exposing its functions to the model
3214
+ *
3215
+ * Contextual path arguments will be populated using the environment's workspace.
3121
3216
  */
3122
- withLLMOutput = (name, description) => {
3123
- const ctx = this._ctx.select("withLLMOutput", { name, description });
3217
+ withModule = (module_) => {
3218
+ const ctx = this._ctx.select("withModule", {
3219
+ module: module_,
3220
+ });
3124
3221
  return new Env(ctx);
3125
3222
  };
3126
3223
  /**
@@ -3320,7 +3417,7 @@ export class Env extends BaseClient {
3320
3417
  return new Env(ctx);
3321
3418
  };
3322
3419
  /**
3323
- * Create or update an input value of type string
3420
+ * Provides a string input binding to the environment
3324
3421
  * @param name The name of the binding
3325
3422
  * @param value The string value to assign to the binding
3326
3423
  * @param description The description of the input
@@ -3334,7 +3431,7 @@ export class Env extends BaseClient {
3334
3431
  return new Env(ctx);
3335
3432
  };
3336
3433
  /**
3337
- * Create or update an input value of type string
3434
+ * Declares a desired string output binding
3338
3435
  * @param name The name of the binding
3339
3436
  * @param description The description of the output
3340
3437
  */
@@ -3342,6 +3439,25 @@ export class Env extends BaseClient {
3342
3439
  const ctx = this._ctx.select("withStringOutput", { name, description });
3343
3440
  return new Env(ctx);
3344
3441
  };
3442
+ /**
3443
+ * Returns a new environment with the provided workspace
3444
+ * @param workspace The directory to set as the host filesystem
3445
+ */
3446
+ withWorkspace = (workspace) => {
3447
+ const ctx = this._ctx.select("withWorkspace", { workspace });
3448
+ return new Env(ctx);
3449
+ };
3450
+ /**
3451
+ * Returns a new environment without any outputs
3452
+ */
3453
+ withoutOutputs = () => {
3454
+ const ctx = this._ctx.select("withoutOutputs");
3455
+ return new Env(ctx);
3456
+ };
3457
+ workspace = () => {
3458
+ const ctx = this._ctx.select("workspace");
3459
+ return new Directory(ctx);
3460
+ };
3345
3461
  /**
3346
3462
  * Call the provided function with current Env.
3347
3463
  *
@@ -3400,20 +3516,22 @@ export class EnvFile extends BaseClient {
3400
3516
  /**
3401
3517
  * Lookup a variable (last occurrence wins) and return its value, or an empty string
3402
3518
  * @param name Variable name
3519
+ * @param opts.raw Return the value exactly as written to the file. No quote removal or variable expansion
3403
3520
  */
3404
- get = async (name) => {
3521
+ get = async (name, opts) => {
3405
3522
  if (this._get) {
3406
3523
  return this._get;
3407
3524
  }
3408
- const ctx = this._ctx.select("get", { name });
3525
+ const ctx = this._ctx.select("get", { name, ...opts });
3409
3526
  const response = await ctx.execute();
3410
3527
  return response;
3411
3528
  };
3412
3529
  /**
3413
3530
  * Return all variables
3531
+ * @param opts.raw Return values exactly as written to the file. No quote removal or variable expansion
3414
3532
  */
3415
- variables = async () => {
3416
- const ctx = this._ctx.select("variables").select("id");
3533
+ variables = async (opts) => {
3534
+ const ctx = this._ctx.select("variables", { ...opts }).select("id");
3417
3535
  const response = await ctx.execute();
3418
3536
  return response.map((r) => new Client(ctx.copy()).loadEnvVariableFromID(r.id));
3419
3537
  };
@@ -4460,32 +4578,6 @@ export class GitRepository extends BaseClient {
4460
4578
  const response = await ctx.execute();
4461
4579
  return response;
4462
4580
  };
4463
- /**
4464
- * Header to authenticate the remote with.
4465
- * @param header Secret used to populate the Authorization HTTP header
4466
- * @deprecated Use "httpAuthHeader" in the constructor instead.
4467
- */
4468
- withAuthHeader = (header) => {
4469
- const ctx = this._ctx.select("withAuthHeader", { header });
4470
- return new GitRepository(ctx);
4471
- };
4472
- /**
4473
- * Token to authenticate the remote with.
4474
- * @param token Secret used to populate the password during basic HTTP Authorization
4475
- * @deprecated Use "httpAuthToken" in the constructor instead.
4476
- */
4477
- withAuthToken = (token) => {
4478
- const ctx = this._ctx.select("withAuthToken", { token });
4479
- return new GitRepository(ctx);
4480
- };
4481
- /**
4482
- * Call the provided function with current GitRepository.
4483
- *
4484
- * This is useful for reusability and readability by not breaking the calling chain.
4485
- */
4486
- with = (arg) => {
4487
- return arg(this);
4488
- };
4489
4581
  }
4490
4582
  /**
4491
4583
  * Information about the host environment.
@@ -4566,18 +4658,6 @@ export class Host extends BaseClient {
4566
4658
  const ctx = this._ctx.select("service", { ports, ...opts });
4567
4659
  return new Service(ctx);
4568
4660
  };
4569
- /**
4570
- * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
4571
- *
4572
- * The file is limited to a size of 512000 bytes.
4573
- * @param name The user defined name for this secret.
4574
- * @param path Location of the file to set as a secret.
4575
- * @deprecated setSecretFile is superceded by use of the secret API with file:// URIs
4576
- */
4577
- setSecretFile = (name, path) => {
4578
- const ctx = this._ctx.select("setSecretFile", { name, path });
4579
- return new Secret(ctx);
4580
- };
4581
4661
  /**
4582
4662
  * Creates a tunnel that forwards traffic from the host to a service.
4583
4663
  * @param service Service to send traffic from the tunnel.
@@ -4881,22 +4961,26 @@ export class JSONValue extends BaseClient {
4881
4961
  }
4882
4962
  export class LLM extends BaseClient {
4883
4963
  _id = undefined;
4964
+ _hasPrompt = undefined;
4884
4965
  _historyJSON = undefined;
4885
4966
  _lastReply = undefined;
4886
4967
  _model = undefined;
4887
4968
  _provider = undefined;
4969
+ _step = undefined;
4888
4970
  _sync = undefined;
4889
4971
  _tools = undefined;
4890
4972
  /**
4891
4973
  * Constructor is used for internal usage only, do not create object from it.
4892
4974
  */
4893
- constructor(ctx, _id, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
4975
+ constructor(ctx, _id, _hasPrompt, _historyJSON, _lastReply, _model, _provider, _step, _sync, _tools) {
4894
4976
  super(ctx);
4895
4977
  this._id = _id;
4978
+ this._hasPrompt = _hasPrompt;
4896
4979
  this._historyJSON = _historyJSON;
4897
4980
  this._lastReply = _lastReply;
4898
4981
  this._model = _model;
4899
4982
  this._provider = _provider;
4983
+ this._step = _step;
4900
4984
  this._sync = _sync;
4901
4985
  this._tools = _tools;
4902
4986
  }
@@ -4934,6 +5018,17 @@ export class LLM extends BaseClient {
4934
5018
  const ctx = this._ctx.select("env");
4935
5019
  return new Env(ctx);
4936
5020
  };
5021
+ /**
5022
+ * Indicates whether there are any queued prompts or tool results to send to the model
5023
+ */
5024
+ hasPrompt = async () => {
5025
+ if (this._hasPrompt) {
5026
+ return this._hasPrompt;
5027
+ }
5028
+ const ctx = this._ctx.select("hasPrompt");
5029
+ const response = await ctx.execute();
5030
+ return response;
5031
+ };
4937
5032
  /**
4938
5033
  * return the llm message history
4939
5034
  */
@@ -4965,7 +5060,7 @@ export class LLM extends BaseClient {
4965
5060
  return response;
4966
5061
  };
4967
5062
  /**
4968
- * synchronize LLM state
5063
+ * Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
4969
5064
  */
4970
5065
  loop = () => {
4971
5066
  const ctx = this._ctx.select("loop");
@@ -4993,6 +5088,14 @@ export class LLM extends BaseClient {
4993
5088
  const response = await ctx.execute();
4994
5089
  return response;
4995
5090
  };
5091
+ /**
5092
+ * Submit the queued prompt or tool call results, evaluate any tool calls, and queue their results
5093
+ */
5094
+ step = async () => {
5095
+ const ctx = this._ctx.select("step");
5096
+ const response = await ctx.execute();
5097
+ return new Client(ctx.copy()).loadLLMFromID(response);
5098
+ };
4996
5099
  /**
4997
5100
  * synchronize LLM state
4998
5101
  */
@@ -5019,6 +5122,20 @@ export class LLM extends BaseClient {
5019
5122
  const response = await ctx.execute();
5020
5123
  return response;
5021
5124
  };
5125
+ /**
5126
+ * Return a new LLM with the specified function no longer exposed as a tool
5127
+ * @param typeName The type name whose function will be blocked
5128
+ * @param function The function to block
5129
+ *
5130
+ * Will be converted to lowerCamelCase if necessary.
5131
+ */
5132
+ withBlockedFunction = (typeName, function_) => {
5133
+ const ctx = this._ctx.select("withBlockedFunction", {
5134
+ typeName,
5135
+ function: function_,
5136
+ });
5137
+ return new LLM(ctx);
5138
+ };
5022
5139
  /**
5023
5140
  * allow the LLM to interact with an environment via MCP
5024
5141
  */
@@ -5026,6 +5143,15 @@ export class LLM extends BaseClient {
5026
5143
  const ctx = this._ctx.select("withEnv", { env });
5027
5144
  return new LLM(ctx);
5028
5145
  };
5146
+ /**
5147
+ * Add an external MCP server to the LLM
5148
+ * @param name The name of the MCP server
5149
+ * @param service The MCP service to run and communicate with over stdio
5150
+ */
5151
+ withMCPServer = (name, service) => {
5152
+ const ctx = this._ctx.select("withMCPServer", { name, service });
5153
+ return new LLM(ctx);
5154
+ };
5029
5155
  /**
5030
5156
  * swap out the llm model
5031
5157
  * @param model The model to use
@@ -5050,6 +5176,13 @@ export class LLM extends BaseClient {
5050
5176
  const ctx = this._ctx.select("withPromptFile", { file });
5051
5177
  return new LLM(ctx);
5052
5178
  };
5179
+ /**
5180
+ * Use a static set of tools for method calls, e.g. for MCP clients that do not support dynamic tool registration
5181
+ */
5182
+ withStaticTools = () => {
5183
+ const ctx = this._ctx.select("withStaticTools");
5184
+ return new LLM(ctx);
5185
+ };
5053
5186
  /**
5054
5187
  * Add a system prompt to the LLM's environment
5055
5188
  * @param prompt The system prompt to send
@@ -5856,6 +5989,14 @@ export class ModuleSource extends BaseClient {
5856
5989
  const ctx = this._ctx.select("withUpdateDependencies", { dependencies });
5857
5990
  return new ModuleSource(ctx);
5858
5991
  };
5992
+ /**
5993
+ * Update one or more clients.
5994
+ * @param clients The clients to update
5995
+ */
5996
+ withUpdatedClients = (clients) => {
5997
+ const ctx = this._ctx.select("withUpdatedClients", { clients });
5998
+ return new ModuleSource(ctx);
5999
+ };
5859
6000
  /**
5860
6001
  * Remove the current blueprint from the module source.
5861
6002
  */
@@ -6077,6 +6218,13 @@ export class Client extends BaseClient {
6077
6218
  getGQLClient() {
6078
6219
  return this._ctx.getGQLClient();
6079
6220
  }
6221
+ /**
6222
+ * initialize an address to load directories, containers, secrets or other object types.
6223
+ */
6224
+ address = (value) => {
6225
+ const ctx = this._ctx.select("address", { value });
6226
+ return new Address(ctx);
6227
+ };
6080
6228
  /**
6081
6229
  * Constructs a cache volume for a given cache key.
6082
6230
  * @param key A string identifier to target this cache volume (e.g., "modules-cache").
@@ -6102,6 +6250,18 @@ export class Client extends BaseClient {
6102
6250
  const ctx = this._ctx.select("container", { ...opts });
6103
6251
  return new Container(ctx);
6104
6252
  };
6253
+ /**
6254
+ * Returns the current environment
6255
+ *
6256
+ * When called from a function invoked via an LLM tool call, this will be the LLM's current environment, including any modifications made through calling tools. Env values returned by functions become the new environment for subsequent calls, and Changeset values returned by functions are applied to the environment's workspace.
6257
+ *
6258
+ * When called from a module function outside of an LLM, this returns an Env with the current module installed, and with the current module's source directory as its workspace.
6259
+ * @experimental
6260
+ */
6261
+ currentEnv = () => {
6262
+ const ctx = this._ctx.select("currentEnv");
6263
+ return new Env(ctx);
6264
+ };
6105
6265
  /**
6106
6266
  * The FunctionCall context that the SDK caller is currently executing in.
6107
6267
  *
@@ -6149,7 +6309,7 @@ export class Client extends BaseClient {
6149
6309
  return new Engine(ctx);
6150
6310
  };
6151
6311
  /**
6152
- * Initialize a new environment
6312
+ * Initializes a new environment
6153
6313
  * @param opts.privileged Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
6154
6314
  * @param opts.writable Allow new outputs to be declared and saved in the environment
6155
6315
  * @experimental
@@ -6255,6 +6415,13 @@ export class Client extends BaseClient {
6255
6415
  const ctx = this._ctx.select("llm", { ...opts });
6256
6416
  return new LLM(ctx);
6257
6417
  };
6418
+ /**
6419
+ * Load a Address from its ID.
6420
+ */
6421
+ loadAddressFromID = (id) => {
6422
+ const ctx = this._ctx.select("loadAddressFromID", { id });
6423
+ return new Address(ctx);
6424
+ };
6258
6425
  /**
6259
6426
  * Load a Binding from its ID.
6260
6427
  */