@dagger.io/dagger 0.18.19 → 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.
- package/dist/src/api/client.gen.d.ts +91 -113
- package/dist/src/api/client.gen.d.ts.map +1 -1
- package/dist/src/api/client.gen.js +126 -118
- package/dist/src/module/decorators.d.ts +2 -0
- package/dist/src/module/decorators.d.ts.map +1 -1
- package/dist/src/module/decorators.js +2 -0
- package/dist/src/module/introspector/dagger_module/module.d.ts +2 -13
- package/dist/src/module/introspector/dagger_module/module.d.ts.map +1 -1
- package/dist/src/module/introspector/dagger_module/module.js +2 -13
- package/dist/src/module/registry.d.ts +2 -0
- package/dist/src/module/registry.d.ts.map +1 -1
- package/dist/src/module/registry.js +2 -0
- package/dist/src/provisioning/default.d.ts +1 -1
- package/dist/src/provisioning/default.d.ts.map +1 -1
- package/dist/src/provisioning/default.js +1 -1
- package/package.json +1 -1
|
@@ -712,13 +712,6 @@ export class Binding extends BaseClient {
|
|
|
712
712
|
const ctx = this._ctx.select("asJSONValue");
|
|
713
713
|
return new JSONValue(ctx);
|
|
714
714
|
};
|
|
715
|
-
/**
|
|
716
|
-
* Retrieve the binding value, as type LLM
|
|
717
|
-
*/
|
|
718
|
-
asLLM = () => {
|
|
719
|
-
const ctx = this._ctx.select("asLLM");
|
|
720
|
-
return new LLM(ctx);
|
|
721
|
-
};
|
|
722
715
|
/**
|
|
723
716
|
* Retrieve the binding value, as type Module
|
|
724
717
|
*/
|
|
@@ -776,7 +769,7 @@ export class Binding extends BaseClient {
|
|
|
776
769
|
return new Socket(ctx);
|
|
777
770
|
};
|
|
778
771
|
/**
|
|
779
|
-
*
|
|
772
|
+
* Returns the binding's string value
|
|
780
773
|
*/
|
|
781
774
|
asString = async () => {
|
|
782
775
|
if (this._asString) {
|
|
@@ -787,7 +780,7 @@ export class Binding extends BaseClient {
|
|
|
787
780
|
return response;
|
|
788
781
|
};
|
|
789
782
|
/**
|
|
790
|
-
*
|
|
783
|
+
* Returns the digest of the binding value
|
|
791
784
|
*/
|
|
792
785
|
digest = async () => {
|
|
793
786
|
if (this._digest) {
|
|
@@ -809,7 +802,7 @@ export class Binding extends BaseClient {
|
|
|
809
802
|
return response;
|
|
810
803
|
};
|
|
811
804
|
/**
|
|
812
|
-
*
|
|
805
|
+
* Returns the binding name
|
|
813
806
|
*/
|
|
814
807
|
name = async () => {
|
|
815
808
|
if (this._name) {
|
|
@@ -820,7 +813,7 @@ export class Binding extends BaseClient {
|
|
|
820
813
|
return response;
|
|
821
814
|
};
|
|
822
815
|
/**
|
|
823
|
-
*
|
|
816
|
+
* Returns the binding type
|
|
824
817
|
*/
|
|
825
818
|
typeName = async () => {
|
|
826
819
|
if (this._typeName) {
|
|
@@ -1089,26 +1082,6 @@ export class Container extends BaseClient {
|
|
|
1089
1082
|
const ctx = this._ctx.select("asTarball", { ...opts, __metadata: metadata });
|
|
1090
1083
|
return new File(ctx);
|
|
1091
1084
|
};
|
|
1092
|
-
/**
|
|
1093
|
-
* Initializes this container from a Dockerfile build.
|
|
1094
|
-
* @param context Directory context used by the Dockerfile.
|
|
1095
|
-
* @param opts.dockerfile Path to the Dockerfile to use.
|
|
1096
|
-
* @param opts.target Target build stage to build.
|
|
1097
|
-
* @param opts.buildArgs Additional build arguments.
|
|
1098
|
-
* @param opts.secrets Secrets to pass to the build.
|
|
1099
|
-
*
|
|
1100
|
-
* They will be mounted at /run/secrets/[secret-name] in the build container
|
|
1101
|
-
*
|
|
1102
|
-
* 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))
|
|
1103
|
-
* @param opts.noInit If set, skip the automatic init process injected into containers created by RUN statements.
|
|
1104
|
-
*
|
|
1105
|
-
* 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.
|
|
1106
|
-
* @deprecated Use `Directory.build` instead
|
|
1107
|
-
*/
|
|
1108
|
-
build = (context, opts) => {
|
|
1109
|
-
const ctx = this._ctx.select("build", { context, ...opts });
|
|
1110
|
-
return new Container(ctx);
|
|
1111
|
-
};
|
|
1112
1085
|
/**
|
|
1113
1086
|
* The combined buffered standard output and standard error stream of the last executed command
|
|
1114
1087
|
*
|
|
@@ -1538,7 +1511,7 @@ export class Container extends BaseClient {
|
|
|
1538
1511
|
/**
|
|
1539
1512
|
* Return a new container snapshot, with a directory added to its filesystem
|
|
1540
1513
|
* @param path Location of the written directory (e.g., "/tmp/directory").
|
|
1541
|
-
* @param
|
|
1514
|
+
* @param source Identifier of the directory to write
|
|
1542
1515
|
* @param opts.exclude Patterns to exclude in the written directory (e.g. ["node_modules/**", ".gitignore", ".git/"]).
|
|
1543
1516
|
* @param opts.include Patterns to include in the written directory (e.g. ["*.go", "go.mod", "go.sum"]).
|
|
1544
1517
|
* @param opts.owner A user:group to set for the directory and its contents.
|
|
@@ -1548,8 +1521,8 @@ export class Container extends BaseClient {
|
|
|
1548
1521
|
* If the group is omitted, it defaults to the same as the user.
|
|
1549
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").
|
|
1550
1523
|
*/
|
|
1551
|
-
withDirectory = (path,
|
|
1552
|
-
const ctx = this._ctx.select("withDirectory", { path,
|
|
1524
|
+
withDirectory = (path, source, opts) => {
|
|
1525
|
+
const ctx = this._ctx.select("withDirectory", { path, source, ...opts });
|
|
1553
1526
|
return new Container(ctx);
|
|
1554
1527
|
};
|
|
1555
1528
|
/**
|
|
@@ -2353,7 +2326,7 @@ export class Directory extends BaseClient {
|
|
|
2353
2326
|
/**
|
|
2354
2327
|
* Return a snapshot with a directory added
|
|
2355
2328
|
* @param path Location of the written directory (e.g., "/src/").
|
|
2356
|
-
* @param
|
|
2329
|
+
* @param source Identifier of the directory to copy.
|
|
2357
2330
|
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
2358
2331
|
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
2359
2332
|
* @param opts.owner A user:group to set for the copied directory and its contents.
|
|
@@ -2362,8 +2335,8 @@ export class Directory extends BaseClient {
|
|
|
2362
2335
|
*
|
|
2363
2336
|
* If the group is omitted, it defaults to the same as the user.
|
|
2364
2337
|
*/
|
|
2365
|
-
withDirectory = (path,
|
|
2366
|
-
const ctx = this._ctx.select("withDirectory", { path,
|
|
2338
|
+
withDirectory = (path, source, opts) => {
|
|
2339
|
+
const ctx = this._ctx.select("withDirectory", { path, source, ...opts });
|
|
2367
2340
|
return new Directory(ctx);
|
|
2368
2341
|
};
|
|
2369
2342
|
/**
|
|
@@ -2516,7 +2489,6 @@ export class Engine extends BaseClient {
|
|
|
2516
2489
|
*/
|
|
2517
2490
|
export class EngineCache extends BaseClient {
|
|
2518
2491
|
_id = undefined;
|
|
2519
|
-
_keepBytes = undefined;
|
|
2520
2492
|
_maxUsedSpace = undefined;
|
|
2521
2493
|
_minFreeSpace = undefined;
|
|
2522
2494
|
_prune = undefined;
|
|
@@ -2525,10 +2497,9 @@ export class EngineCache extends BaseClient {
|
|
|
2525
2497
|
/**
|
|
2526
2498
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2527
2499
|
*/
|
|
2528
|
-
constructor(ctx, _id,
|
|
2500
|
+
constructor(ctx, _id, _maxUsedSpace, _minFreeSpace, _prune, _reservedSpace, _targetSpace) {
|
|
2529
2501
|
super(ctx);
|
|
2530
2502
|
this._id = _id;
|
|
2531
|
-
this._keepBytes = _keepBytes;
|
|
2532
2503
|
this._maxUsedSpace = _maxUsedSpace;
|
|
2533
2504
|
this._minFreeSpace = _minFreeSpace;
|
|
2534
2505
|
this._prune = _prune;
|
|
@@ -2553,18 +2524,6 @@ export class EngineCache extends BaseClient {
|
|
|
2553
2524
|
const ctx = this._ctx.select("entrySet", { ...opts });
|
|
2554
2525
|
return new EngineCacheEntrySet(ctx);
|
|
2555
2526
|
};
|
|
2556
|
-
/**
|
|
2557
|
-
* The maximum bytes to keep in the cache without pruning, after which automatic pruning may kick in.
|
|
2558
|
-
* @deprecated Use minFreeSpace instead.
|
|
2559
|
-
*/
|
|
2560
|
-
keepBytes = async () => {
|
|
2561
|
-
if (this._keepBytes) {
|
|
2562
|
-
return this._keepBytes;
|
|
2563
|
-
}
|
|
2564
|
-
const ctx = this._ctx.select("keepBytes");
|
|
2565
|
-
const response = await ctx.execute();
|
|
2566
|
-
return response;
|
|
2567
|
-
};
|
|
2568
2527
|
/**
|
|
2569
2528
|
* The maximum bytes to keep in the cache without pruning.
|
|
2570
2529
|
*/
|
|
@@ -2945,14 +2904,14 @@ export class Env extends BaseClient {
|
|
|
2945
2904
|
return response;
|
|
2946
2905
|
};
|
|
2947
2906
|
/**
|
|
2948
|
-
*
|
|
2907
|
+
* Retrieves an input binding by name
|
|
2949
2908
|
*/
|
|
2950
2909
|
input = (name) => {
|
|
2951
2910
|
const ctx = this._ctx.select("input", { name });
|
|
2952
2911
|
return new Binding(ctx);
|
|
2953
2912
|
};
|
|
2954
2913
|
/**
|
|
2955
|
-
*
|
|
2914
|
+
* Returns all input bindings provided to the environment
|
|
2956
2915
|
*/
|
|
2957
2916
|
inputs = async () => {
|
|
2958
2917
|
const ctx = this._ctx.select("inputs").select("id");
|
|
@@ -2960,14 +2919,14 @@ export class Env extends BaseClient {
|
|
|
2960
2919
|
return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
|
|
2961
2920
|
};
|
|
2962
2921
|
/**
|
|
2963
|
-
*
|
|
2922
|
+
* Retrieves an output binding by name
|
|
2964
2923
|
*/
|
|
2965
2924
|
output = (name) => {
|
|
2966
2925
|
const ctx = this._ctx.select("output", { name });
|
|
2967
2926
|
return new Binding(ctx);
|
|
2968
2927
|
};
|
|
2969
2928
|
/**
|
|
2970
|
-
*
|
|
2929
|
+
* Returns all declared output bindings for the environment
|
|
2971
2930
|
*/
|
|
2972
2931
|
outputs = async () => {
|
|
2973
2932
|
const ctx = this._ctx.select("outputs").select("id");
|
|
@@ -3085,6 +3044,15 @@ export class Env extends BaseClient {
|
|
|
3085
3044
|
const ctx = this._ctx.select("withContainerOutput", { name, description });
|
|
3086
3045
|
return new Env(ctx);
|
|
3087
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
|
+
};
|
|
3088
3056
|
/**
|
|
3089
3057
|
* Create or update a binding of type Directory in the environment
|
|
3090
3058
|
* @param name The name of the binding
|
|
@@ -3242,22 +3210,14 @@ export class Env extends BaseClient {
|
|
|
3242
3210
|
return new Env(ctx);
|
|
3243
3211
|
};
|
|
3244
3212
|
/**
|
|
3245
|
-
*
|
|
3246
|
-
*
|
|
3247
|
-
*
|
|
3248
|
-
* @param description The purpose of the input
|
|
3249
|
-
*/
|
|
3250
|
-
withLLMInput = (name, value, description) => {
|
|
3251
|
-
const ctx = this._ctx.select("withLLMInput", { name, value, description });
|
|
3252
|
-
return new Env(ctx);
|
|
3253
|
-
};
|
|
3254
|
-
/**
|
|
3255
|
-
* Declare a desired LLM output to be assigned in the environment
|
|
3256
|
-
* @param name The name of the binding
|
|
3257
|
-
* @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.
|
|
3258
3216
|
*/
|
|
3259
|
-
|
|
3260
|
-
const ctx = this._ctx.select("
|
|
3217
|
+
withModule = (module_) => {
|
|
3218
|
+
const ctx = this._ctx.select("withModule", {
|
|
3219
|
+
module: module_,
|
|
3220
|
+
});
|
|
3261
3221
|
return new Env(ctx);
|
|
3262
3222
|
};
|
|
3263
3223
|
/**
|
|
@@ -3457,7 +3417,7 @@ export class Env extends BaseClient {
|
|
|
3457
3417
|
return new Env(ctx);
|
|
3458
3418
|
};
|
|
3459
3419
|
/**
|
|
3460
|
-
*
|
|
3420
|
+
* Provides a string input binding to the environment
|
|
3461
3421
|
* @param name The name of the binding
|
|
3462
3422
|
* @param value The string value to assign to the binding
|
|
3463
3423
|
* @param description The description of the input
|
|
@@ -3471,7 +3431,7 @@ export class Env extends BaseClient {
|
|
|
3471
3431
|
return new Env(ctx);
|
|
3472
3432
|
};
|
|
3473
3433
|
/**
|
|
3474
|
-
*
|
|
3434
|
+
* Declares a desired string output binding
|
|
3475
3435
|
* @param name The name of the binding
|
|
3476
3436
|
* @param description The description of the output
|
|
3477
3437
|
*/
|
|
@@ -3479,6 +3439,25 @@ export class Env extends BaseClient {
|
|
|
3479
3439
|
const ctx = this._ctx.select("withStringOutput", { name, description });
|
|
3480
3440
|
return new Env(ctx);
|
|
3481
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
|
+
};
|
|
3482
3461
|
/**
|
|
3483
3462
|
* Call the provided function with current Env.
|
|
3484
3463
|
*
|
|
@@ -3537,20 +3516,22 @@ export class EnvFile extends BaseClient {
|
|
|
3537
3516
|
/**
|
|
3538
3517
|
* Lookup a variable (last occurrence wins) and return its value, or an empty string
|
|
3539
3518
|
* @param name Variable name
|
|
3519
|
+
* @param opts.raw Return the value exactly as written to the file. No quote removal or variable expansion
|
|
3540
3520
|
*/
|
|
3541
|
-
get = async (name) => {
|
|
3521
|
+
get = async (name, opts) => {
|
|
3542
3522
|
if (this._get) {
|
|
3543
3523
|
return this._get;
|
|
3544
3524
|
}
|
|
3545
|
-
const ctx = this._ctx.select("get", { name });
|
|
3525
|
+
const ctx = this._ctx.select("get", { name, ...opts });
|
|
3546
3526
|
const response = await ctx.execute();
|
|
3547
3527
|
return response;
|
|
3548
3528
|
};
|
|
3549
3529
|
/**
|
|
3550
3530
|
* Return all variables
|
|
3531
|
+
* @param opts.raw Return values exactly as written to the file. No quote removal or variable expansion
|
|
3551
3532
|
*/
|
|
3552
|
-
variables = async () => {
|
|
3553
|
-
const ctx = this._ctx.select("variables").select("id");
|
|
3533
|
+
variables = async (opts) => {
|
|
3534
|
+
const ctx = this._ctx.select("variables", { ...opts }).select("id");
|
|
3554
3535
|
const response = await ctx.execute();
|
|
3555
3536
|
return response.map((r) => new Client(ctx.copy()).loadEnvVariableFromID(r.id));
|
|
3556
3537
|
};
|
|
@@ -4597,32 +4578,6 @@ export class GitRepository extends BaseClient {
|
|
|
4597
4578
|
const response = await ctx.execute();
|
|
4598
4579
|
return response;
|
|
4599
4580
|
};
|
|
4600
|
-
/**
|
|
4601
|
-
* Header to authenticate the remote with.
|
|
4602
|
-
* @param header Secret used to populate the Authorization HTTP header
|
|
4603
|
-
* @deprecated Use "httpAuthHeader" in the constructor instead.
|
|
4604
|
-
*/
|
|
4605
|
-
withAuthHeader = (header) => {
|
|
4606
|
-
const ctx = this._ctx.select("withAuthHeader", { header });
|
|
4607
|
-
return new GitRepository(ctx);
|
|
4608
|
-
};
|
|
4609
|
-
/**
|
|
4610
|
-
* Token to authenticate the remote with.
|
|
4611
|
-
* @param token Secret used to populate the password during basic HTTP Authorization
|
|
4612
|
-
* @deprecated Use "httpAuthToken" in the constructor instead.
|
|
4613
|
-
*/
|
|
4614
|
-
withAuthToken = (token) => {
|
|
4615
|
-
const ctx = this._ctx.select("withAuthToken", { token });
|
|
4616
|
-
return new GitRepository(ctx);
|
|
4617
|
-
};
|
|
4618
|
-
/**
|
|
4619
|
-
* Call the provided function with current GitRepository.
|
|
4620
|
-
*
|
|
4621
|
-
* This is useful for reusability and readability by not breaking the calling chain.
|
|
4622
|
-
*/
|
|
4623
|
-
with = (arg) => {
|
|
4624
|
-
return arg(this);
|
|
4625
|
-
};
|
|
4626
4581
|
}
|
|
4627
4582
|
/**
|
|
4628
4583
|
* Information about the host environment.
|
|
@@ -4703,18 +4658,6 @@ export class Host extends BaseClient {
|
|
|
4703
4658
|
const ctx = this._ctx.select("service", { ports, ...opts });
|
|
4704
4659
|
return new Service(ctx);
|
|
4705
4660
|
};
|
|
4706
|
-
/**
|
|
4707
|
-
* Sets a secret given a user-defined name and the file path on the host, and returns the secret.
|
|
4708
|
-
*
|
|
4709
|
-
* The file is limited to a size of 512000 bytes.
|
|
4710
|
-
* @param name The user defined name for this secret.
|
|
4711
|
-
* @param path Location of the file to set as a secret.
|
|
4712
|
-
* @deprecated setSecretFile is superceded by use of the secret API with file:// URIs
|
|
4713
|
-
*/
|
|
4714
|
-
setSecretFile = (name, path) => {
|
|
4715
|
-
const ctx = this._ctx.select("setSecretFile", { name, path });
|
|
4716
|
-
return new Secret(ctx);
|
|
4717
|
-
};
|
|
4718
4661
|
/**
|
|
4719
4662
|
* Creates a tunnel that forwards traffic from the host to a service.
|
|
4720
4663
|
* @param service Service to send traffic from the tunnel.
|
|
@@ -5018,22 +4961,26 @@ export class JSONValue extends BaseClient {
|
|
|
5018
4961
|
}
|
|
5019
4962
|
export class LLM extends BaseClient {
|
|
5020
4963
|
_id = undefined;
|
|
4964
|
+
_hasPrompt = undefined;
|
|
5021
4965
|
_historyJSON = undefined;
|
|
5022
4966
|
_lastReply = undefined;
|
|
5023
4967
|
_model = undefined;
|
|
5024
4968
|
_provider = undefined;
|
|
4969
|
+
_step = undefined;
|
|
5025
4970
|
_sync = undefined;
|
|
5026
4971
|
_tools = undefined;
|
|
5027
4972
|
/**
|
|
5028
4973
|
* Constructor is used for internal usage only, do not create object from it.
|
|
5029
4974
|
*/
|
|
5030
|
-
constructor(ctx, _id, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
|
|
4975
|
+
constructor(ctx, _id, _hasPrompt, _historyJSON, _lastReply, _model, _provider, _step, _sync, _tools) {
|
|
5031
4976
|
super(ctx);
|
|
5032
4977
|
this._id = _id;
|
|
4978
|
+
this._hasPrompt = _hasPrompt;
|
|
5033
4979
|
this._historyJSON = _historyJSON;
|
|
5034
4980
|
this._lastReply = _lastReply;
|
|
5035
4981
|
this._model = _model;
|
|
5036
4982
|
this._provider = _provider;
|
|
4983
|
+
this._step = _step;
|
|
5037
4984
|
this._sync = _sync;
|
|
5038
4985
|
this._tools = _tools;
|
|
5039
4986
|
}
|
|
@@ -5071,6 +5018,17 @@ export class LLM extends BaseClient {
|
|
|
5071
5018
|
const ctx = this._ctx.select("env");
|
|
5072
5019
|
return new Env(ctx);
|
|
5073
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
|
+
};
|
|
5074
5032
|
/**
|
|
5075
5033
|
* return the llm message history
|
|
5076
5034
|
*/
|
|
@@ -5102,7 +5060,7 @@ export class LLM extends BaseClient {
|
|
|
5102
5060
|
return response;
|
|
5103
5061
|
};
|
|
5104
5062
|
/**
|
|
5105
|
-
*
|
|
5063
|
+
* Submit the queued prompt, evaluate any tool calls, queue their results, and keep going until the model ends its turn
|
|
5106
5064
|
*/
|
|
5107
5065
|
loop = () => {
|
|
5108
5066
|
const ctx = this._ctx.select("loop");
|
|
@@ -5130,6 +5088,14 @@ export class LLM extends BaseClient {
|
|
|
5130
5088
|
const response = await ctx.execute();
|
|
5131
5089
|
return response;
|
|
5132
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
|
+
};
|
|
5133
5099
|
/**
|
|
5134
5100
|
* synchronize LLM state
|
|
5135
5101
|
*/
|
|
@@ -5156,6 +5122,20 @@ export class LLM extends BaseClient {
|
|
|
5156
5122
|
const response = await ctx.execute();
|
|
5157
5123
|
return response;
|
|
5158
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
|
+
};
|
|
5159
5139
|
/**
|
|
5160
5140
|
* allow the LLM to interact with an environment via MCP
|
|
5161
5141
|
*/
|
|
@@ -5163,6 +5143,15 @@ export class LLM extends BaseClient {
|
|
|
5163
5143
|
const ctx = this._ctx.select("withEnv", { env });
|
|
5164
5144
|
return new LLM(ctx);
|
|
5165
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
|
+
};
|
|
5166
5155
|
/**
|
|
5167
5156
|
* swap out the llm model
|
|
5168
5157
|
* @param model The model to use
|
|
@@ -5187,6 +5176,13 @@ export class LLM extends BaseClient {
|
|
|
5187
5176
|
const ctx = this._ctx.select("withPromptFile", { file });
|
|
5188
5177
|
return new LLM(ctx);
|
|
5189
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
|
+
};
|
|
5190
5186
|
/**
|
|
5191
5187
|
* Add a system prompt to the LLM's environment
|
|
5192
5188
|
* @param prompt The system prompt to send
|
|
@@ -6254,6 +6250,18 @@ export class Client extends BaseClient {
|
|
|
6254
6250
|
const ctx = this._ctx.select("container", { ...opts });
|
|
6255
6251
|
return new Container(ctx);
|
|
6256
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
|
+
};
|
|
6257
6265
|
/**
|
|
6258
6266
|
* The FunctionCall context that the SDK caller is currently executing in.
|
|
6259
6267
|
*
|
|
@@ -6301,7 +6309,7 @@ export class Client extends BaseClient {
|
|
|
6301
6309
|
return new Engine(ctx);
|
|
6302
6310
|
};
|
|
6303
6311
|
/**
|
|
6304
|
-
*
|
|
6312
|
+
* Initializes a new environment
|
|
6305
6313
|
* @param opts.privileged Give the environment the same privileges as the caller: core API including host access, current module, and dependencies
|
|
6306
6314
|
* @param opts.writable Allow new outputs to be declared and saved in the environment
|
|
6307
6315
|
* @experimental
|
|
@@ -22,6 +22,8 @@ export declare const field: (alias?: string) => ((target: object, propertyKey: s
|
|
|
22
22
|
/**
|
|
23
23
|
* The definition of the `@enumType` decorator that should be on top of any
|
|
24
24
|
* class module that must be exposed to the Dagger API as enumeration.
|
|
25
|
+
*
|
|
26
|
+
* @deprecated In favor of using TypeScript `enum` types.
|
|
25
27
|
*/
|
|
26
28
|
export declare const enumType: () => (<T extends import("./registry.js").Class>(constructor: T) => T);
|
|
27
29
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,
|
|
1
|
+
{"version":3,"file":"decorators.d.ts","sourceRoot":"","sources":["../../../src/module/decorators.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,eAAO,MAAM,MAAM,wEAAkB,CAAA;AAErC;;;;;GAKG;AACH,eAAO,MAAM,IAAI,gFAoCqtC,CAAC,8BApCtsC,CAAA;AAEjC;;;;;;GAMG;AACH,eAAO,MAAM,KAAK,qEAAiB,CAAA;AAEnC;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,wEAAoB,CAAA;AAEzC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,QAAQ,yIAAoB,CAAA"}
|
|
@@ -26,6 +26,8 @@ export const field = registry.field;
|
|
|
26
26
|
/**
|
|
27
27
|
* The definition of the `@enumType` decorator that should be on top of any
|
|
28
28
|
* class module that must be exposed to the Dagger API as enumeration.
|
|
29
|
+
*
|
|
30
|
+
* @deprecated In favor of using TypeScript `enum` types.
|
|
29
31
|
*/
|
|
30
32
|
export const enumType = registry.enumType;
|
|
31
33
|
/**
|
|
@@ -38,19 +38,8 @@ export declare class DaggerModule {
|
|
|
38
38
|
*/
|
|
39
39
|
objects: DaggerObjectsBase;
|
|
40
40
|
/**
|
|
41
|
-
* An enum is
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```ts
|
|
46
|
-
* @enumType()
|
|
47
|
-
* export class Example {
|
|
48
|
-
* static A: string = "a"
|
|
49
|
-
* static B: string = "b"
|
|
50
|
-
* }
|
|
51
|
-
* ```
|
|
52
|
-
*
|
|
53
|
-
* or
|
|
41
|
+
* An enum is typically a native TypeScript enum declared with the `enum` keyword.
|
|
42
|
+
* Decorated classes using `@enumType()` are still supported for backward compatibility.
|
|
54
43
|
*
|
|
55
44
|
* @example
|
|
56
45
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/module.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAKhC,OAAO,EAEL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAmB,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAInD;;;;;;;;GAQG;AACH,qBAAa,YAAY;
|
|
1
|
+
{"version":3,"file":"module.d.ts","sourceRoot":"","sources":["../../../../../src/module/introspector/dagger_module/module.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,aAAa,CAAA;AAKhC,OAAO,EAEL,GAAG,EAGJ,MAAM,+BAA+B,CAAA;AAGtC,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAA;AAE/C,OAAO,EAAmB,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAElE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAA;AAInD;;;;;;;;GAQG;AACH,qBAAa,YAAY;IA4Dd,IAAI,EAAE,MAAM;IACnB,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,GAAG;IA7Db;;;;;;;;;;;;;;;;;;;OAmBG;IACI,OAAO,EAAE,iBAAiB,CAAK;IAEtC;;;;;;;;;;;OAWG;IACI,KAAK,EAAE,eAAe,CAAK;IAElC;;;;;;;;;;OAUG;IACI,UAAU,EAAE,gBAAgB,CAAK;IAEjC,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;IAEtC,OAAO,CAAC,UAAU,CAKjB;gBAGQ,IAAI,EAAE,MAAM,EACX,UAAU,EAAE,MAAM,EAAE,EACpB,GAAG,EAAE,GAAG;IA8BlB;;;;;;;;;;;;;;;OAeG;IACH,OAAO,CAAC,iBAAiB;IAkIzB;;;;;;;;;;;OAWG;IACH,OAAO,CAAC,gBAAgB;IAsExB;;OAEG;IACH,OAAO,CAAC,WAAW;IA2BnB;;OAEG;IACH,OAAO,CAAC,mBAAmB;IAU3B;;OAEG;IACH,OAAO,CAAC,cAAc;IAgBtB,MAAM;;;;;;;CASP"}
|
|
@@ -43,19 +43,8 @@ export class DaggerModule {
|
|
|
43
43
|
*/
|
|
44
44
|
objects = {};
|
|
45
45
|
/**
|
|
46
|
-
* An enum is
|
|
47
|
-
*
|
|
48
|
-
*
|
|
49
|
-
* @example
|
|
50
|
-
* ```ts
|
|
51
|
-
* @enumType()
|
|
52
|
-
* export class Example {
|
|
53
|
-
* static A: string = "a"
|
|
54
|
-
* static B: string = "b"
|
|
55
|
-
* }
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* or
|
|
46
|
+
* An enum is typically a native TypeScript enum declared with the `enum` keyword.
|
|
47
|
+
* Decorated classes using `@enumType()` are still supported for backward compatibility.
|
|
59
48
|
*
|
|
60
49
|
* @example
|
|
61
50
|
* ```ts
|
|
@@ -46,6 +46,8 @@ export declare class Registry {
|
|
|
46
46
|
/**
|
|
47
47
|
* The definition of the @enum decorator that should be on top of any
|
|
48
48
|
* class module that must be exposed to the Dagger API as enumeration.
|
|
49
|
+
*
|
|
50
|
+
* @deprecated In favor of using TypeScript `enum` types.
|
|
49
51
|
*/
|
|
50
52
|
enumType: () => (<T extends Class>(constructor: T) => T);
|
|
51
53
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/module/registry.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAA;AAIzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAU1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,MAAM,QAAO,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAMpD;IAED
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../../src/module/registry.ts"],"names":[],"mappings":"AAIA,OAAO,kBAAkB,CAAA;AAIzB,MAAM,MAAM,KAAK,GAAG;IAAE,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,GAAG,GAAG,CAAA;CAAE,CAAA;AAEjD,MAAM,MAAM,KAAK,GAAG;IAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,GAAG,CAAA;CAAE,CAAA;AAE/C,MAAM,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;AAU1C,MAAM,MAAM,eAAe,GAAG;IAC5B;;;;;;;OAOG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IAEpB;;;;OAIG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;;;GAaG;AACH,qBAAa,QAAQ;IACnB;;;OAGG;IACH,MAAM,QAAO,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAMpD;IAED;;;;;OAKG;IACH,QAAQ,QAAO,CAAC,CAAC,CAAC,SAAS,KAAK,EAAE,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,CAItD;IAED;;;;;;OAMG;IACH,KAAK,GAAI,QAAQ,MAAM,KAAG,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC,CAIxE;IAED;;;OAGG;IACH,IAAI,GACF,QAAQ,MAAM,KACb,CAAC,CACF,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,MAAM,EAC5B,UAAU,CAAC,EAAE,kBAAkB,KAC5B,IAAI,CAAC,CAMT;IAED,QAAQ,GACN,OAAO,eAAe,KACrB,CAAC,CACF,MAAM,EAAE,MAAM,EACd,WAAW,EAAE,MAAM,GAAG,SAAS,EAC/B,cAAc,EAAE,MAAM,KACnB,IAAI,CAAC,CAMT;IAED;;;;;OAKG;IACH,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,GAAG;IAY7C;;;;;;;;;;OAUG;IACG,SAAS,CACb,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,KAAK,EACZ,MAAM,EAAE,IAAI,GACX,OAAO,CAAC,GAAG,CAAC;CAiChB;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,UAAiB,CAAA"}
|
|
@@ -32,6 +32,8 @@ export class Registry {
|
|
|
32
32
|
/**
|
|
33
33
|
* The definition of the @enum decorator that should be on top of any
|
|
34
34
|
* class module that must be exposed to the Dagger API as enumeration.
|
|
35
|
+
*
|
|
36
|
+
* @deprecated In favor of using TypeScript `enum` types.
|
|
35
37
|
*/
|
|
36
38
|
enumType = () => {
|
|
37
39
|
return (constructor) => {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const CLI_VERSION = "0.
|
|
1
|
+
export declare const CLI_VERSION = "0.19.0";
|
|
2
2
|
//# sourceMappingURL=default.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/provisioning/default.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../src/provisioning/default.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,WAAW,WAAW,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Code generated by dagger. DO NOT EDIT.
|
|
2
|
-
export const CLI_VERSION = "0.
|
|
2
|
+
export const CLI_VERSION = "0.19.0";
|