@dagger.io/dagger 0.16.2 → 0.17.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.
@@ -1203,6 +1203,13 @@ export class Directory extends BaseClient {
1203
1203
  const response = await ctx.execute();
1204
1204
  return response;
1205
1205
  };
1206
+ /**
1207
+ * Converts this directory into a git repository
1208
+ */
1209
+ asGit = () => {
1210
+ const ctx = this._ctx.select("asGit");
1211
+ return new GitRepository(ctx);
1212
+ };
1206
1213
  /**
1207
1214
  * Load the directory as a Dagger module source
1208
1215
  * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
@@ -1917,6 +1924,78 @@ export class Error extends BaseClient {
1917
1924
  const response = await ctx.execute();
1918
1925
  return response;
1919
1926
  };
1927
+ /**
1928
+ * The extensions of the error.
1929
+ */
1930
+ values = async () => {
1931
+ const ctx = this._ctx.select("values").select("id");
1932
+ const response = await ctx.execute();
1933
+ return response.map((r) => new Client(ctx.copy()).loadErrorValueFromID(r.id));
1934
+ };
1935
+ /**
1936
+ * Add a value to the error.
1937
+ * @param name The name of the value.
1938
+ * @param value The value to store on the error.
1939
+ */
1940
+ withValue = (name, value) => {
1941
+ const ctx = this._ctx.select("withValue", { name, value });
1942
+ return new Error(ctx);
1943
+ };
1944
+ /**
1945
+ * Call the provided function with current Error.
1946
+ *
1947
+ * This is useful for reusability and readability by not breaking the calling chain.
1948
+ */
1949
+ with = (arg) => {
1950
+ return arg(this);
1951
+ };
1952
+ }
1953
+ export class ErrorValue extends BaseClient {
1954
+ _id = undefined;
1955
+ _name = undefined;
1956
+ _value = undefined;
1957
+ /**
1958
+ * Constructor is used for internal usage only, do not create object from it.
1959
+ */
1960
+ constructor(ctx, _id, _name, _value) {
1961
+ super(ctx);
1962
+ this._id = _id;
1963
+ this._name = _name;
1964
+ this._value = _value;
1965
+ }
1966
+ /**
1967
+ * A unique identifier for this ErrorValue.
1968
+ */
1969
+ id = async () => {
1970
+ if (this._id) {
1971
+ return this._id;
1972
+ }
1973
+ const ctx = this._ctx.select("id");
1974
+ const response = await ctx.execute();
1975
+ return response;
1976
+ };
1977
+ /**
1978
+ * The name of the value.
1979
+ */
1980
+ name = async () => {
1981
+ if (this._name) {
1982
+ return this._name;
1983
+ }
1984
+ const ctx = this._ctx.select("name");
1985
+ const response = await ctx.execute();
1986
+ return response;
1987
+ };
1988
+ /**
1989
+ * The value.
1990
+ */
1991
+ value = async () => {
1992
+ if (this._value) {
1993
+ return this._value;
1994
+ }
1995
+ const ctx = this._ctx.select("value");
1996
+ const response = await ctx.execute();
1997
+ return response;
1998
+ };
1920
1999
  }
1921
2000
  /**
1922
2001
  * A definition of a field on a custom object defined in a Module.
@@ -2898,24 +2977,31 @@ export class InterfaceTypeDef extends BaseClient {
2898
2977
  return response;
2899
2978
  };
2900
2979
  }
2901
- /**
2902
- * A simple key value object that represents a label.
2903
- */
2904
- export class Label extends BaseClient {
2980
+ export class LLM extends BaseClient {
2905
2981
  _id = undefined;
2906
- _name = undefined;
2907
- _value = undefined;
2982
+ _getString = undefined;
2983
+ _historyJSON = undefined;
2984
+ _lastReply = undefined;
2985
+ _model = undefined;
2986
+ _provider = undefined;
2987
+ _sync = undefined;
2988
+ _tools = undefined;
2908
2989
  /**
2909
2990
  * Constructor is used for internal usage only, do not create object from it.
2910
2991
  */
2911
- constructor(ctx, _id, _name, _value) {
2992
+ constructor(ctx, _id, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
2912
2993
  super(ctx);
2913
2994
  this._id = _id;
2914
- this._name = _name;
2915
- this._value = _value;
2995
+ this._getString = _getString;
2996
+ this._historyJSON = _historyJSON;
2997
+ this._lastReply = _lastReply;
2998
+ this._model = _model;
2999
+ this._provider = _provider;
3000
+ this._sync = _sync;
3001
+ this._tools = _tools;
2916
3002
  }
2917
3003
  /**
2918
- * A unique identifier for this Label.
3004
+ * A unique identifier for this LLM.
2919
3005
  */
2920
3006
  id = async () => {
2921
3007
  if (this._id) {
@@ -2926,232 +3012,1645 @@ export class Label extends BaseClient {
2926
3012
  return response;
2927
3013
  };
2928
3014
  /**
2929
- * The label name.
3015
+ * Retrieve a the current value in the LLM environment, of type CacheVolume
3016
+ * @deprecated use get<TargetType> instead
2930
3017
  */
2931
- name = async () => {
2932
- if (this._name) {
2933
- return this._name;
2934
- }
2935
- const ctx = this._ctx.select("name");
2936
- const response = await ctx.execute();
2937
- return response;
3018
+ cacheVolume = () => {
3019
+ const ctx = this._ctx.select("cacheVolume");
3020
+ return new CacheVolume(ctx);
2938
3021
  };
2939
3022
  /**
2940
- * The label value.
3023
+ * Retrieve a the current value in the LLM environment, of type Container
3024
+ * @deprecated use get<TargetType> instead
2941
3025
  */
2942
- value = async () => {
2943
- if (this._value) {
2944
- return this._value;
2945
- }
2946
- const ctx = this._ctx.select("value");
2947
- const response = await ctx.execute();
2948
- return response;
3026
+ container = () => {
3027
+ const ctx = this._ctx.select("container");
3028
+ return new Container(ctx);
2949
3029
  };
2950
- }
2951
- /**
2952
- * A definition of a list type in a Module.
2953
- */
2954
- export class ListTypeDef extends BaseClient {
2955
- _id = undefined;
2956
3030
  /**
2957
- * Constructor is used for internal usage only, do not create object from it.
3031
+ * Retrieve a the current value in the LLM environment, of type CurrentModule
3032
+ * @deprecated use get<TargetType> instead
2958
3033
  */
2959
- constructor(ctx, _id) {
2960
- super(ctx);
2961
- this._id = _id;
2962
- }
3034
+ currentModule = () => {
3035
+ const ctx = this._ctx.select("currentModule");
3036
+ return new CurrentModule(ctx);
3037
+ };
2963
3038
  /**
2964
- * A unique identifier for this ListTypeDef.
3039
+ * Retrieve a the current value in the LLM environment, of type Directory
3040
+ * @deprecated use get<TargetType> instead
2965
3041
  */
2966
- id = async () => {
2967
- if (this._id) {
2968
- return this._id;
2969
- }
2970
- const ctx = this._ctx.select("id");
2971
- const response = await ctx.execute();
2972
- return response;
3042
+ directory = () => {
3043
+ const ctx = this._ctx.select("directory");
3044
+ return new Directory(ctx);
2973
3045
  };
2974
3046
  /**
2975
- * The type of the elements in the list.
3047
+ * Retrieve a the current value in the LLM environment, of type EnumTypeDef
3048
+ * @deprecated use get<TargetType> instead
2976
3049
  */
2977
- elementTypeDef = () => {
2978
- const ctx = this._ctx.select("elementTypeDef");
2979
- return new TypeDef(ctx);
3050
+ enumTypeDef = () => {
3051
+ const ctx = this._ctx.select("enumTypeDef");
3052
+ return new EnumTypeDef(ctx);
2980
3053
  };
2981
- }
2982
- /**
2983
- * A Dagger module.
2984
- */
2985
- export class Module_ extends BaseClient {
2986
- _id = undefined;
2987
- _description = undefined;
2988
- _name = undefined;
2989
- _serve = undefined;
2990
- _sync = undefined;
2991
3054
  /**
2992
- * Constructor is used for internal usage only, do not create object from it.
3055
+ * Retrieve a the current value in the LLM environment, of type EnumValueTypeDef
3056
+ * @deprecated use get<TargetType> instead
2993
3057
  */
2994
- constructor(ctx, _id, _description, _name, _serve, _sync) {
2995
- super(ctx);
2996
- this._id = _id;
2997
- this._description = _description;
2998
- this._name = _name;
2999
- this._serve = _serve;
3000
- this._sync = _sync;
3001
- }
3058
+ enumValueTypeDef = () => {
3059
+ const ctx = this._ctx.select("enumValueTypeDef");
3060
+ return new EnumValueTypeDef(ctx);
3061
+ };
3002
3062
  /**
3003
- * A unique identifier for this Module.
3063
+ * Retrieve a the current value in the LLM environment, of type Error
3064
+ * @deprecated use get<TargetType> instead
3004
3065
  */
3005
- id = async () => {
3006
- if (this._id) {
3007
- return this._id;
3008
- }
3009
- const ctx = this._ctx.select("id");
3010
- const response = await ctx.execute();
3011
- return response;
3066
+ error = () => {
3067
+ const ctx = this._ctx.select("error");
3068
+ return new Error(ctx);
3012
3069
  };
3013
3070
  /**
3014
- * The dependencies of the module.
3071
+ * Retrieve a the current value in the LLM environment, of type ErrorValue
3072
+ * @deprecated use get<TargetType> instead
3015
3073
  */
3016
- dependencies = async () => {
3017
- const ctx = this._ctx.select("dependencies").select("id");
3018
- const response = await ctx.execute();
3019
- return response.map((r) => new Client(ctx.copy()).loadModuleFromID(r.id));
3074
+ errorValue = () => {
3075
+ const ctx = this._ctx.select("errorValue");
3076
+ return new ErrorValue(ctx);
3020
3077
  };
3021
3078
  /**
3022
- * The doc string of the module, if any
3079
+ * Retrieve a the current value in the LLM environment, of type FieldTypeDef
3080
+ * @deprecated use get<TargetType> instead
3023
3081
  */
3024
- description = async () => {
3025
- if (this._description) {
3026
- return this._description;
3027
- }
3028
- const ctx = this._ctx.select("description");
3029
- const response = await ctx.execute();
3030
- return response;
3082
+ fieldTypeDef = () => {
3083
+ const ctx = this._ctx.select("fieldTypeDef");
3084
+ return new FieldTypeDef(ctx);
3031
3085
  };
3032
3086
  /**
3033
- * Enumerations served by this module.
3087
+ * Retrieve a the current value in the LLM environment, of type File
3088
+ * @deprecated use get<TargetType> instead
3034
3089
  */
3035
- enums = async () => {
3036
- const ctx = this._ctx.select("enums").select("id");
3037
- const response = await ctx.execute();
3038
- return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
3090
+ file = () => {
3091
+ const ctx = this._ctx.select("file");
3092
+ return new File(ctx);
3039
3093
  };
3040
3094
  /**
3041
- * The generated files and directories made on top of the module source's context directory.
3095
+ * Retrieve a the current value in the LLM environment, of type Function
3096
+ * @deprecated use get<TargetType> instead
3042
3097
  */
3043
- generatedContextDirectory = () => {
3044
- const ctx = this._ctx.select("generatedContextDirectory");
3045
- return new Directory(ctx);
3098
+ function_ = () => {
3099
+ const ctx = this._ctx.select("function");
3100
+ return new Function_(ctx);
3046
3101
  };
3047
3102
  /**
3048
- * Interfaces served by this module.
3103
+ * Retrieve a the current value in the LLM environment, of type FunctionArg
3104
+ * @deprecated use get<TargetType> instead
3049
3105
  */
3050
- interfaces = async () => {
3051
- const ctx = this._ctx.select("interfaces").select("id");
3052
- const response = await ctx.execute();
3053
- return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
3106
+ functionArg = () => {
3107
+ const ctx = this._ctx.select("functionArg");
3108
+ return new FunctionArg(ctx);
3054
3109
  };
3055
3110
  /**
3056
- * The name of the module
3111
+ * Retrieve a the current value in the LLM environment, of type FunctionCall
3112
+ * @deprecated use get<TargetType> instead
3057
3113
  */
3058
- name = async () => {
3059
- if (this._name) {
3060
- return this._name;
3061
- }
3062
- const ctx = this._ctx.select("name");
3063
- const response = await ctx.execute();
3064
- return response;
3114
+ functionCall = () => {
3115
+ const ctx = this._ctx.select("functionCall");
3116
+ return new FunctionCall(ctx);
3065
3117
  };
3066
3118
  /**
3067
- * Objects served by this module.
3119
+ * Retrieve a the current value in the LLM environment, of type FunctionCallArgValue
3120
+ * @deprecated use get<TargetType> instead
3068
3121
  */
3069
- objects = async () => {
3070
- const ctx = this._ctx.select("objects").select("id");
3071
- const response = await ctx.execute();
3072
- return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
3122
+ functionCallArgValue = () => {
3123
+ const ctx = this._ctx.select("functionCallArgValue");
3124
+ return new FunctionCallArgValue(ctx);
3073
3125
  };
3074
3126
  /**
3075
- * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
3127
+ * Retrieve a the current value in the LLM environment, of type GeneratedCode
3128
+ * @deprecated use get<TargetType> instead
3076
3129
  */
3077
- runtime = () => {
3078
- const ctx = this._ctx.select("runtime");
3079
- return new Container(ctx);
3130
+ generatedCode = () => {
3131
+ const ctx = this._ctx.select("generatedCode");
3132
+ return new GeneratedCode(ctx);
3080
3133
  };
3081
3134
  /**
3082
- * The SDK config used by this module.
3135
+ * Retrieve a variable in the llm environment, of type CacheVolume
3136
+ * @param name The name of the variable
3083
3137
  */
3084
- sdk = () => {
3085
- const ctx = this._ctx.select("sdk");
3086
- return new SDKConfig(ctx);
3138
+ getCacheVolume = (name) => {
3139
+ const ctx = this._ctx.select("getCacheVolume", { name });
3140
+ return new CacheVolume(ctx);
3087
3141
  };
3088
3142
  /**
3089
- * Serve a module's API in the current session.
3090
- *
3091
- * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
3143
+ * Retrieve a variable in the llm environment, of type Container
3144
+ * @param name The name of the variable
3092
3145
  */
3093
- serve = async () => {
3094
- if (this._serve) {
3095
- return;
3096
- }
3097
- const ctx = this._ctx.select("serve");
3098
- await ctx.execute();
3146
+ getContainer = (name) => {
3147
+ const ctx = this._ctx.select("getContainer", { name });
3148
+ return new Container(ctx);
3099
3149
  };
3100
3150
  /**
3101
- * The source for the module.
3151
+ * Retrieve a variable in the llm environment, of type CurrentModule
3152
+ * @param name The name of the variable
3102
3153
  */
3103
- source = () => {
3104
- const ctx = this._ctx.select("source");
3105
- return new ModuleSource(ctx);
3154
+ getCurrentModule = (name) => {
3155
+ const ctx = this._ctx.select("getCurrentModule", { name });
3156
+ return new CurrentModule(ctx);
3106
3157
  };
3107
3158
  /**
3108
- * Forces evaluation of the module, including any loading into the engine and associated validation.
3159
+ * Retrieve a variable in the llm environment, of type Directory
3160
+ * @param name The name of the variable
3109
3161
  */
3110
- sync = async () => {
3111
- const ctx = this._ctx.select("sync");
3112
- const response = await ctx.execute();
3113
- return new Client(ctx.copy()).loadModuleFromID(response);
3162
+ getDirectory = (name) => {
3163
+ const ctx = this._ctx.select("getDirectory", { name });
3164
+ return new Directory(ctx);
3114
3165
  };
3115
3166
  /**
3116
- * Retrieves the module with the given description
3117
- * @param description The description to set
3167
+ * Retrieve a variable in the llm environment, of type EnumTypeDef
3168
+ * @param name The name of the variable
3118
3169
  */
3119
- withDescription = (description) => {
3120
- const ctx = this._ctx.select("withDescription", { description });
3121
- return new Module_(ctx);
3170
+ getEnumTypeDef = (name) => {
3171
+ const ctx = this._ctx.select("getEnumTypeDef", { name });
3172
+ return new EnumTypeDef(ctx);
3122
3173
  };
3123
3174
  /**
3124
- * This module plus the given Enum type and associated values
3175
+ * Retrieve a variable in the llm environment, of type EnumValueTypeDef
3176
+ * @param name The name of the variable
3125
3177
  */
3126
- withEnum = (enum_) => {
3127
- const ctx = this._ctx.select("withEnum", {
3128
- enum: enum_,
3129
- });
3130
- return new Module_(ctx);
3178
+ getEnumValueTypeDef = (name) => {
3179
+ const ctx = this._ctx.select("getEnumValueTypeDef", { name });
3180
+ return new EnumValueTypeDef(ctx);
3131
3181
  };
3132
3182
  /**
3133
- * This module plus the given Interface type and associated functions
3183
+ * Retrieve a variable in the llm environment, of type Error
3184
+ * @param name The name of the variable
3134
3185
  */
3135
- withInterface = (iface) => {
3136
- const ctx = this._ctx.select("withInterface", { iface });
3137
- return new Module_(ctx);
3186
+ getError = (name) => {
3187
+ const ctx = this._ctx.select("getError", { name });
3188
+ return new Error(ctx);
3138
3189
  };
3139
3190
  /**
3140
- * This module plus the given Object type and associated functions.
3191
+ * Retrieve a variable in the llm environment, of type ErrorValue
3192
+ * @param name The name of the variable
3141
3193
  */
3142
- withObject = (object) => {
3143
- const ctx = this._ctx.select("withObject", { object });
3144
- return new Module_(ctx);
3194
+ getErrorValue = (name) => {
3195
+ const ctx = this._ctx.select("getErrorValue", { name });
3196
+ return new ErrorValue(ctx);
3145
3197
  };
3146
3198
  /**
3147
- * Call the provided function with current Module.
3148
- *
3199
+ * Retrieve a variable in the llm environment, of type FieldTypeDef
3200
+ * @param name The name of the variable
3201
+ */
3202
+ getFieldTypeDef = (name) => {
3203
+ const ctx = this._ctx.select("getFieldTypeDef", { name });
3204
+ return new FieldTypeDef(ctx);
3205
+ };
3206
+ /**
3207
+ * Retrieve a variable in the llm environment, of type File
3208
+ * @param name The name of the variable
3209
+ */
3210
+ getFile = (name) => {
3211
+ const ctx = this._ctx.select("getFile", { name });
3212
+ return new File(ctx);
3213
+ };
3214
+ /**
3215
+ * Retrieve a variable in the llm environment, of type Function
3216
+ * @param name The name of the variable
3217
+ */
3218
+ getFunction = (name) => {
3219
+ const ctx = this._ctx.select("getFunction", { name });
3220
+ return new Function_(ctx);
3221
+ };
3222
+ /**
3223
+ * Retrieve a variable in the llm environment, of type FunctionArg
3224
+ * @param name The name of the variable
3225
+ */
3226
+ getFunctionArg = (name) => {
3227
+ const ctx = this._ctx.select("getFunctionArg", { name });
3228
+ return new FunctionArg(ctx);
3229
+ };
3230
+ /**
3231
+ * Retrieve a variable in the llm environment, of type FunctionCall
3232
+ * @param name The name of the variable
3233
+ */
3234
+ getFunctionCall = (name) => {
3235
+ const ctx = this._ctx.select("getFunctionCall", { name });
3236
+ return new FunctionCall(ctx);
3237
+ };
3238
+ /**
3239
+ * Retrieve a variable in the llm environment, of type FunctionCallArgValue
3240
+ * @param name The name of the variable
3241
+ */
3242
+ getFunctionCallArgValue = (name) => {
3243
+ const ctx = this._ctx.select("getFunctionCallArgValue", { name });
3244
+ return new FunctionCallArgValue(ctx);
3245
+ };
3246
+ /**
3247
+ * Retrieve a variable in the llm environment, of type GeneratedCode
3248
+ * @param name The name of the variable
3249
+ */
3250
+ getGeneratedCode = (name) => {
3251
+ const ctx = this._ctx.select("getGeneratedCode", { name });
3252
+ return new GeneratedCode(ctx);
3253
+ };
3254
+ /**
3255
+ * Retrieve a variable in the llm environment, of type GitRef
3256
+ * @param name The name of the variable
3257
+ */
3258
+ getGitRef = (name) => {
3259
+ const ctx = this._ctx.select("getGitRef", { name });
3260
+ return new GitRef(ctx);
3261
+ };
3262
+ /**
3263
+ * Retrieve a variable in the llm environment, of type GitRepository
3264
+ * @param name The name of the variable
3265
+ */
3266
+ getGitRepository = (name) => {
3267
+ const ctx = this._ctx.select("getGitRepository", { name });
3268
+ return new GitRepository(ctx);
3269
+ };
3270
+ /**
3271
+ * Retrieve a variable in the llm environment, of type InputTypeDef
3272
+ * @param name The name of the variable
3273
+ */
3274
+ getInputTypeDef = (name) => {
3275
+ const ctx = this._ctx.select("getInputTypeDef", { name });
3276
+ return new InputTypeDef(ctx);
3277
+ };
3278
+ /**
3279
+ * Retrieve a variable in the llm environment, of type InterfaceTypeDef
3280
+ * @param name The name of the variable
3281
+ */
3282
+ getInterfaceTypeDef = (name) => {
3283
+ const ctx = this._ctx.select("getInterfaceTypeDef", { name });
3284
+ return new InterfaceTypeDef(ctx);
3285
+ };
3286
+ /**
3287
+ * Retrieve a variable in the llm environment, of type LLM
3288
+ * @param name The name of the variable
3289
+ */
3290
+ getLLM = (name) => {
3291
+ const ctx = this._ctx.select("getLLM", { name });
3292
+ return new LLM(ctx);
3293
+ };
3294
+ /**
3295
+ * Retrieve a variable in the llm environment, of type ListTypeDef
3296
+ * @param name The name of the variable
3297
+ */
3298
+ getListTypeDef = (name) => {
3299
+ const ctx = this._ctx.select("getListTypeDef", { name });
3300
+ return new ListTypeDef(ctx);
3301
+ };
3302
+ /**
3303
+ * Retrieve a variable in the llm environment, of type Module
3304
+ * @param name The name of the variable
3305
+ */
3306
+ getModule = (name) => {
3307
+ const ctx = this._ctx.select("getModule", { name });
3308
+ return new Module_(ctx);
3309
+ };
3310
+ /**
3311
+ * Retrieve a variable in the llm environment, of type ModuleConfigClient
3312
+ * @param name The name of the variable
3313
+ */
3314
+ getModuleConfigClient = (name) => {
3315
+ const ctx = this._ctx.select("getModuleConfigClient", { name });
3316
+ return new ModuleConfigClient(ctx);
3317
+ };
3318
+ /**
3319
+ * Retrieve a variable in the llm environment, of type ModuleSource
3320
+ * @param name The name of the variable
3321
+ */
3322
+ getModuleSource = (name) => {
3323
+ const ctx = this._ctx.select("getModuleSource", { name });
3324
+ return new ModuleSource(ctx);
3325
+ };
3326
+ /**
3327
+ * Retrieve a variable in the llm environment, of type ObjectTypeDef
3328
+ * @param name The name of the variable
3329
+ */
3330
+ getObjectTypeDef = (name) => {
3331
+ const ctx = this._ctx.select("getObjectTypeDef", { name });
3332
+ return new ObjectTypeDef(ctx);
3333
+ };
3334
+ /**
3335
+ * Retrieve a variable in the llm environment, of type SDKConfig
3336
+ * @param name The name of the variable
3337
+ */
3338
+ getSDKConfig = (name) => {
3339
+ const ctx = this._ctx.select("getSDKConfig", { name });
3340
+ return new SDKConfig(ctx);
3341
+ };
3342
+ /**
3343
+ * Retrieve a variable in the llm environment, of type ScalarTypeDef
3344
+ * @param name The name of the variable
3345
+ */
3346
+ getScalarTypeDef = (name) => {
3347
+ const ctx = this._ctx.select("getScalarTypeDef", { name });
3348
+ return new ScalarTypeDef(ctx);
3349
+ };
3350
+ /**
3351
+ * Retrieve a variable in the llm environment, of type Secret
3352
+ * @param name The name of the variable
3353
+ */
3354
+ getSecret = (name) => {
3355
+ const ctx = this._ctx.select("getSecret", { name });
3356
+ return new Secret(ctx);
3357
+ };
3358
+ /**
3359
+ * Retrieve a variable in the llm environment, of type Service
3360
+ * @param name The name of the variable
3361
+ */
3362
+ getService = (name) => {
3363
+ const ctx = this._ctx.select("getService", { name });
3364
+ return new Service(ctx);
3365
+ };
3366
+ /**
3367
+ * Retrieve a variable in the llm environment, of type Socket
3368
+ * @param name The name of the variable
3369
+ */
3370
+ getSocket = (name) => {
3371
+ const ctx = this._ctx.select("getSocket", { name });
3372
+ return new Socket(ctx);
3373
+ };
3374
+ /**
3375
+ * Retrieve a variable in the llm environment, of type SourceMap
3376
+ * @param name The name of the variable
3377
+ */
3378
+ getSourceMap = (name) => {
3379
+ const ctx = this._ctx.select("getSourceMap", { name });
3380
+ return new SourceMap(ctx);
3381
+ };
3382
+ /**
3383
+ * Get a string variable from the LLM's environment
3384
+ * @param name The variable name
3385
+ */
3386
+ getString = async (name) => {
3387
+ if (this._getString) {
3388
+ return this._getString;
3389
+ }
3390
+ const ctx = this._ctx.select("getString", { name });
3391
+ const response = await ctx.execute();
3392
+ return response;
3393
+ };
3394
+ /**
3395
+ * Retrieve a variable in the llm environment, of type Terminal
3396
+ * @param name The name of the variable
3397
+ */
3398
+ getTerminal = (name) => {
3399
+ const ctx = this._ctx.select("getTerminal", { name });
3400
+ return new Terminal(ctx);
3401
+ };
3402
+ /**
3403
+ * Retrieve a variable in the llm environment, of type TypeDef
3404
+ * @param name The name of the variable
3405
+ */
3406
+ getTypeDef = (name) => {
3407
+ const ctx = this._ctx.select("getTypeDef", { name });
3408
+ return new TypeDef(ctx);
3409
+ };
3410
+ /**
3411
+ * Retrieve a the current value in the LLM environment, of type GitRef
3412
+ * @deprecated use get<TargetType> instead
3413
+ */
3414
+ gitRef = () => {
3415
+ const ctx = this._ctx.select("gitRef");
3416
+ return new GitRef(ctx);
3417
+ };
3418
+ /**
3419
+ * Retrieve a the current value in the LLM environment, of type GitRepository
3420
+ * @deprecated use get<TargetType> instead
3421
+ */
3422
+ gitRepository = () => {
3423
+ const ctx = this._ctx.select("gitRepository");
3424
+ return new GitRepository(ctx);
3425
+ };
3426
+ /**
3427
+ * return the llm message history
3428
+ */
3429
+ history = async () => {
3430
+ const ctx = this._ctx.select("history");
3431
+ const response = await ctx.execute();
3432
+ return response;
3433
+ };
3434
+ /**
3435
+ * return the raw llm message history as json
3436
+ */
3437
+ historyJSON = async () => {
3438
+ if (this._historyJSON) {
3439
+ return this._historyJSON;
3440
+ }
3441
+ const ctx = this._ctx.select("historyJSON");
3442
+ const response = await ctx.execute();
3443
+ return response;
3444
+ };
3445
+ /**
3446
+ * Retrieve a the current value in the LLM environment, of type InputTypeDef
3447
+ * @deprecated use get<TargetType> instead
3448
+ */
3449
+ inputTypeDef = () => {
3450
+ const ctx = this._ctx.select("inputTypeDef");
3451
+ return new InputTypeDef(ctx);
3452
+ };
3453
+ /**
3454
+ * Retrieve a the current value in the LLM environment, of type InterfaceTypeDef
3455
+ * @deprecated use get<TargetType> instead
3456
+ */
3457
+ interfaceTypeDef = () => {
3458
+ const ctx = this._ctx.select("interfaceTypeDef");
3459
+ return new InterfaceTypeDef(ctx);
3460
+ };
3461
+ /**
3462
+ * Retrieve a the current value in the LLM environment, of type LLM
3463
+ * @deprecated use get<TargetType> instead
3464
+ */
3465
+ lLM = () => {
3466
+ const ctx = this._ctx.select("lLM");
3467
+ return new LLM(ctx);
3468
+ };
3469
+ /**
3470
+ * return the last llm reply from the history
3471
+ */
3472
+ lastReply = async () => {
3473
+ if (this._lastReply) {
3474
+ return this._lastReply;
3475
+ }
3476
+ const ctx = this._ctx.select("lastReply");
3477
+ const response = await ctx.execute();
3478
+ return response;
3479
+ };
3480
+ /**
3481
+ * Retrieve a the current value in the LLM environment, of type ListTypeDef
3482
+ * @deprecated use get<TargetType> instead
3483
+ */
3484
+ listTypeDef = () => {
3485
+ const ctx = this._ctx.select("listTypeDef");
3486
+ return new ListTypeDef(ctx);
3487
+ };
3488
+ /**
3489
+ * synchronize LLM state
3490
+ * @deprecated use sync
3491
+ */
3492
+ loop = () => {
3493
+ const ctx = this._ctx.select("loop");
3494
+ return new LLM(ctx);
3495
+ };
3496
+ /**
3497
+ * return the model used by the llm
3498
+ */
3499
+ model = async () => {
3500
+ if (this._model) {
3501
+ return this._model;
3502
+ }
3503
+ const ctx = this._ctx.select("model");
3504
+ const response = await ctx.execute();
3505
+ return response;
3506
+ };
3507
+ /**
3508
+ * Retrieve a the current value in the LLM environment, of type Module
3509
+ * @deprecated use get<TargetType> instead
3510
+ */
3511
+ module_ = () => {
3512
+ const ctx = this._ctx.select("module");
3513
+ return new Module_(ctx);
3514
+ };
3515
+ /**
3516
+ * Retrieve a the current value in the LLM environment, of type ModuleConfigClient
3517
+ * @deprecated use get<TargetType> instead
3518
+ */
3519
+ moduleConfigClient = () => {
3520
+ const ctx = this._ctx.select("moduleConfigClient");
3521
+ return new ModuleConfigClient(ctx);
3522
+ };
3523
+ /**
3524
+ * Retrieve a the current value in the LLM environment, of type ModuleSource
3525
+ * @deprecated use get<TargetType> instead
3526
+ */
3527
+ moduleSource = () => {
3528
+ const ctx = this._ctx.select("moduleSource");
3529
+ return new ModuleSource(ctx);
3530
+ };
3531
+ /**
3532
+ * Retrieve a the current value in the LLM environment, of type ObjectTypeDef
3533
+ * @deprecated use get<TargetType> instead
3534
+ */
3535
+ objectTypeDef = () => {
3536
+ const ctx = this._ctx.select("objectTypeDef");
3537
+ return new ObjectTypeDef(ctx);
3538
+ };
3539
+ /**
3540
+ * return the provider used by the llm
3541
+ */
3542
+ provider = async () => {
3543
+ if (this._provider) {
3544
+ return this._provider;
3545
+ }
3546
+ const ctx = this._ctx.select("provider");
3547
+ const response = await ctx.execute();
3548
+ return response;
3549
+ };
3550
+ /**
3551
+ * Retrieve a the current value in the LLM environment, of type ScalarTypeDef
3552
+ * @deprecated use get<TargetType> instead
3553
+ */
3554
+ scalarTypeDef = () => {
3555
+ const ctx = this._ctx.select("scalarTypeDef");
3556
+ return new ScalarTypeDef(ctx);
3557
+ };
3558
+ /**
3559
+ * Retrieve a the current value in the LLM environment, of type SDKConfig
3560
+ * @deprecated use get<TargetType> instead
3561
+ */
3562
+ sdkconfig = () => {
3563
+ const ctx = this._ctx.select("sdkconfig");
3564
+ return new SDKConfig(ctx);
3565
+ };
3566
+ /**
3567
+ * Retrieve a the current value in the LLM environment, of type Secret
3568
+ * @deprecated use get<TargetType> instead
3569
+ */
3570
+ secret = () => {
3571
+ const ctx = this._ctx.select("secret");
3572
+ return new Secret(ctx);
3573
+ };
3574
+ /**
3575
+ * Retrieve a the current value in the LLM environment, of type Service
3576
+ * @deprecated use get<TargetType> instead
3577
+ */
3578
+ service = () => {
3579
+ const ctx = this._ctx.select("service");
3580
+ return new Service(ctx);
3581
+ };
3582
+ /**
3583
+ * Set a variable of type CacheVolume in the llm environment
3584
+ * @param name The name of the variable
3585
+ * @param value The CacheVolume value to assign to the variable
3586
+ */
3587
+ setCacheVolume = (name, value) => {
3588
+ const ctx = this._ctx.select("setCacheVolume", { name, value });
3589
+ return new LLM(ctx);
3590
+ };
3591
+ /**
3592
+ * Set a variable of type Container in the llm environment
3593
+ * @param name The name of the variable
3594
+ * @param value The Container value to assign to the variable
3595
+ */
3596
+ setContainer = (name, value) => {
3597
+ const ctx = this._ctx.select("setContainer", { name, value });
3598
+ return new LLM(ctx);
3599
+ };
3600
+ /**
3601
+ * Set a variable of type CurrentModule in the llm environment
3602
+ * @param name The name of the variable
3603
+ * @param value The CurrentModule value to assign to the variable
3604
+ */
3605
+ setCurrentModule = (name, value) => {
3606
+ const ctx = this._ctx.select("setCurrentModule", { name, value });
3607
+ return new LLM(ctx);
3608
+ };
3609
+ /**
3610
+ * Set a variable of type Directory in the llm environment
3611
+ * @param name The name of the variable
3612
+ * @param value The Directory value to assign to the variable
3613
+ */
3614
+ setDirectory = (name, value) => {
3615
+ const ctx = this._ctx.select("setDirectory", { name, value });
3616
+ return new LLM(ctx);
3617
+ };
3618
+ /**
3619
+ * Set a variable of type EnumTypeDef in the llm environment
3620
+ * @param name The name of the variable
3621
+ * @param value The EnumTypeDef value to assign to the variable
3622
+ */
3623
+ setEnumTypeDef = (name, value) => {
3624
+ const ctx = this._ctx.select("setEnumTypeDef", { name, value });
3625
+ return new LLM(ctx);
3626
+ };
3627
+ /**
3628
+ * Set a variable of type EnumValueTypeDef in the llm environment
3629
+ * @param name The name of the variable
3630
+ * @param value The EnumValueTypeDef value to assign to the variable
3631
+ */
3632
+ setEnumValueTypeDef = (name, value) => {
3633
+ const ctx = this._ctx.select("setEnumValueTypeDef", { name, value });
3634
+ return new LLM(ctx);
3635
+ };
3636
+ /**
3637
+ * Set a variable of type Error in the llm environment
3638
+ * @param name The name of the variable
3639
+ * @param value The Error value to assign to the variable
3640
+ */
3641
+ setError = (name, value) => {
3642
+ const ctx = this._ctx.select("setError", { name, value });
3643
+ return new LLM(ctx);
3644
+ };
3645
+ /**
3646
+ * Set a variable of type ErrorValue in the llm environment
3647
+ * @param name The name of the variable
3648
+ * @param value The ErrorValue value to assign to the variable
3649
+ */
3650
+ setErrorValue = (name, value) => {
3651
+ const ctx = this._ctx.select("setErrorValue", { name, value });
3652
+ return new LLM(ctx);
3653
+ };
3654
+ /**
3655
+ * Set a variable of type FieldTypeDef in the llm environment
3656
+ * @param name The name of the variable
3657
+ * @param value The FieldTypeDef value to assign to the variable
3658
+ */
3659
+ setFieldTypeDef = (name, value) => {
3660
+ const ctx = this._ctx.select("setFieldTypeDef", { name, value });
3661
+ return new LLM(ctx);
3662
+ };
3663
+ /**
3664
+ * Set a variable of type File in the llm environment
3665
+ * @param name The name of the variable
3666
+ * @param value The File value to assign to the variable
3667
+ */
3668
+ setFile = (name, value) => {
3669
+ const ctx = this._ctx.select("setFile", { name, value });
3670
+ return new LLM(ctx);
3671
+ };
3672
+ /**
3673
+ * Set a variable of type Function in the llm environment
3674
+ * @param name The name of the variable
3675
+ * @param value The Function value to assign to the variable
3676
+ */
3677
+ setFunction = (name, value) => {
3678
+ const ctx = this._ctx.select("setFunction", { name, value });
3679
+ return new LLM(ctx);
3680
+ };
3681
+ /**
3682
+ * Set a variable of type FunctionArg in the llm environment
3683
+ * @param name The name of the variable
3684
+ * @param value The FunctionArg value to assign to the variable
3685
+ */
3686
+ setFunctionArg = (name, value) => {
3687
+ const ctx = this._ctx.select("setFunctionArg", { name, value });
3688
+ return new LLM(ctx);
3689
+ };
3690
+ /**
3691
+ * Set a variable of type FunctionCall in the llm environment
3692
+ * @param name The name of the variable
3693
+ * @param value The FunctionCall value to assign to the variable
3694
+ */
3695
+ setFunctionCall = (name, value) => {
3696
+ const ctx = this._ctx.select("setFunctionCall", { name, value });
3697
+ return new LLM(ctx);
3698
+ };
3699
+ /**
3700
+ * Set a variable of type FunctionCallArgValue in the llm environment
3701
+ * @param name The name of the variable
3702
+ * @param value The FunctionCallArgValue value to assign to the variable
3703
+ */
3704
+ setFunctionCallArgValue = (name, value) => {
3705
+ const ctx = this._ctx.select("setFunctionCallArgValue", { name, value });
3706
+ return new LLM(ctx);
3707
+ };
3708
+ /**
3709
+ * Set a variable of type GeneratedCode in the llm environment
3710
+ * @param name The name of the variable
3711
+ * @param value The GeneratedCode value to assign to the variable
3712
+ */
3713
+ setGeneratedCode = (name, value) => {
3714
+ const ctx = this._ctx.select("setGeneratedCode", { name, value });
3715
+ return new LLM(ctx);
3716
+ };
3717
+ /**
3718
+ * Set a variable of type GitRef in the llm environment
3719
+ * @param name The name of the variable
3720
+ * @param value The GitRef value to assign to the variable
3721
+ */
3722
+ setGitRef = (name, value) => {
3723
+ const ctx = this._ctx.select("setGitRef", { name, value });
3724
+ return new LLM(ctx);
3725
+ };
3726
+ /**
3727
+ * Set a variable of type GitRepository in the llm environment
3728
+ * @param name The name of the variable
3729
+ * @param value The GitRepository value to assign to the variable
3730
+ */
3731
+ setGitRepository = (name, value) => {
3732
+ const ctx = this._ctx.select("setGitRepository", { name, value });
3733
+ return new LLM(ctx);
3734
+ };
3735
+ /**
3736
+ * Set a variable of type InputTypeDef in the llm environment
3737
+ * @param name The name of the variable
3738
+ * @param value The InputTypeDef value to assign to the variable
3739
+ */
3740
+ setInputTypeDef = (name, value) => {
3741
+ const ctx = this._ctx.select("setInputTypeDef", { name, value });
3742
+ return new LLM(ctx);
3743
+ };
3744
+ /**
3745
+ * Set a variable of type InterfaceTypeDef in the llm environment
3746
+ * @param name The name of the variable
3747
+ * @param value The InterfaceTypeDef value to assign to the variable
3748
+ */
3749
+ setInterfaceTypeDef = (name, value) => {
3750
+ const ctx = this._ctx.select("setInterfaceTypeDef", { name, value });
3751
+ return new LLM(ctx);
3752
+ };
3753
+ /**
3754
+ * Set a variable of type LLM in the llm environment
3755
+ * @param name The name of the variable
3756
+ * @param value The LLM value to assign to the variable
3757
+ */
3758
+ setLLM = (name, value) => {
3759
+ const ctx = this._ctx.select("setLLM", { name, value });
3760
+ return new LLM(ctx);
3761
+ };
3762
+ /**
3763
+ * Set a variable of type ListTypeDef in the llm environment
3764
+ * @param name The name of the variable
3765
+ * @param value The ListTypeDef value to assign to the variable
3766
+ */
3767
+ setListTypeDef = (name, value) => {
3768
+ const ctx = this._ctx.select("setListTypeDef", { name, value });
3769
+ return new LLM(ctx);
3770
+ };
3771
+ /**
3772
+ * Set a variable of type Module in the llm environment
3773
+ * @param name The name of the variable
3774
+ * @param value The Module value to assign to the variable
3775
+ */
3776
+ setModule = (name, value) => {
3777
+ const ctx = this._ctx.select("setModule", { name, value });
3778
+ return new LLM(ctx);
3779
+ };
3780
+ /**
3781
+ * Set a variable of type ModuleConfigClient in the llm environment
3782
+ * @param name The name of the variable
3783
+ * @param value The ModuleConfigClient value to assign to the variable
3784
+ */
3785
+ setModuleConfigClient = (name, value) => {
3786
+ const ctx = this._ctx.select("setModuleConfigClient", { name, value });
3787
+ return new LLM(ctx);
3788
+ };
3789
+ /**
3790
+ * Set a variable of type ModuleSource in the llm environment
3791
+ * @param name The name of the variable
3792
+ * @param value The ModuleSource value to assign to the variable
3793
+ */
3794
+ setModuleSource = (name, value) => {
3795
+ const ctx = this._ctx.select("setModuleSource", { name, value });
3796
+ return new LLM(ctx);
3797
+ };
3798
+ /**
3799
+ * Set a variable of type ObjectTypeDef in the llm environment
3800
+ * @param name The name of the variable
3801
+ * @param value The ObjectTypeDef value to assign to the variable
3802
+ */
3803
+ setObjectTypeDef = (name, value) => {
3804
+ const ctx = this._ctx.select("setObjectTypeDef", { name, value });
3805
+ return new LLM(ctx);
3806
+ };
3807
+ /**
3808
+ * Set a variable of type SDKConfig in the llm environment
3809
+ * @param name The name of the variable
3810
+ * @param value The SDKConfig value to assign to the variable
3811
+ */
3812
+ setSDKConfig = (name, value) => {
3813
+ const ctx = this._ctx.select("setSDKConfig", { name, value });
3814
+ return new LLM(ctx);
3815
+ };
3816
+ /**
3817
+ * Set a variable of type ScalarTypeDef in the llm environment
3818
+ * @param name The name of the variable
3819
+ * @param value The ScalarTypeDef value to assign to the variable
3820
+ */
3821
+ setScalarTypeDef = (name, value) => {
3822
+ const ctx = this._ctx.select("setScalarTypeDef", { name, value });
3823
+ return new LLM(ctx);
3824
+ };
3825
+ /**
3826
+ * Set a variable of type Secret in the llm environment
3827
+ * @param name The name of the variable
3828
+ * @param value The Secret value to assign to the variable
3829
+ */
3830
+ setSecret = (name, value) => {
3831
+ const ctx = this._ctx.select("setSecret", { name, value });
3832
+ return new LLM(ctx);
3833
+ };
3834
+ /**
3835
+ * Set a variable of type Service in the llm environment
3836
+ * @param name The name of the variable
3837
+ * @param value The Service value to assign to the variable
3838
+ */
3839
+ setService = (name, value) => {
3840
+ const ctx = this._ctx.select("setService", { name, value });
3841
+ return new LLM(ctx);
3842
+ };
3843
+ /**
3844
+ * Set a variable of type Socket in the llm environment
3845
+ * @param name The name of the variable
3846
+ * @param value The Socket value to assign to the variable
3847
+ */
3848
+ setSocket = (name, value) => {
3849
+ const ctx = this._ctx.select("setSocket", { name, value });
3850
+ return new LLM(ctx);
3851
+ };
3852
+ /**
3853
+ * Set a variable of type SourceMap in the llm environment
3854
+ * @param name The name of the variable
3855
+ * @param value The SourceMap value to assign to the variable
3856
+ */
3857
+ setSourceMap = (name, value) => {
3858
+ const ctx = this._ctx.select("setSourceMap", { name, value });
3859
+ return new LLM(ctx);
3860
+ };
3861
+ /**
3862
+ * Add a string variable to the LLM's environment
3863
+ * @param name The variable name
3864
+ * @param value The variable value
3865
+ */
3866
+ setString = (name, value) => {
3867
+ const ctx = this._ctx.select("setString", { name, value });
3868
+ return new LLM(ctx);
3869
+ };
3870
+ /**
3871
+ * Set a variable of type Terminal in the llm environment
3872
+ * @param name The name of the variable
3873
+ * @param value The Terminal value to assign to the variable
3874
+ */
3875
+ setTerminal = (name, value) => {
3876
+ const ctx = this._ctx.select("setTerminal", { name, value });
3877
+ return new LLM(ctx);
3878
+ };
3879
+ /**
3880
+ * Set a variable of type TypeDef in the llm environment
3881
+ * @param name The name of the variable
3882
+ * @param value The TypeDef value to assign to the variable
3883
+ */
3884
+ setTypeDef = (name, value) => {
3885
+ const ctx = this._ctx.select("setTypeDef", { name, value });
3886
+ return new LLM(ctx);
3887
+ };
3888
+ /**
3889
+ * Retrieve a the current value in the LLM environment, of type Socket
3890
+ * @deprecated use get<TargetType> instead
3891
+ */
3892
+ socket = () => {
3893
+ const ctx = this._ctx.select("socket");
3894
+ return new Socket(ctx);
3895
+ };
3896
+ /**
3897
+ * Retrieve a the current value in the LLM environment, of type SourceMap
3898
+ * @deprecated use get<TargetType> instead
3899
+ */
3900
+ sourceMap = () => {
3901
+ const ctx = this._ctx.select("sourceMap");
3902
+ return new SourceMap(ctx);
3903
+ };
3904
+ /**
3905
+ * synchronize LLM state
3906
+ */
3907
+ sync = async () => {
3908
+ const ctx = this._ctx.select("sync");
3909
+ const response = await ctx.execute();
3910
+ return new Client(ctx.copy()).loadLLMFromID(response);
3911
+ };
3912
+ /**
3913
+ * Retrieve a the current value in the LLM environment, of type Terminal
3914
+ * @deprecated use get<TargetType> instead
3915
+ */
3916
+ terminal = () => {
3917
+ const ctx = this._ctx.select("terminal");
3918
+ return new Terminal(ctx);
3919
+ };
3920
+ /**
3921
+ * print documentation for available tools
3922
+ */
3923
+ tools = async () => {
3924
+ if (this._tools) {
3925
+ return this._tools;
3926
+ }
3927
+ const ctx = this._ctx.select("tools");
3928
+ const response = await ctx.execute();
3929
+ return response;
3930
+ };
3931
+ /**
3932
+ * Retrieve a the current value in the LLM environment, of type TypeDef
3933
+ * @deprecated use get<TargetType> instead
3934
+ */
3935
+ typeDef = () => {
3936
+ const ctx = this._ctx.select("typeDef");
3937
+ return new TypeDef(ctx);
3938
+ };
3939
+ /**
3940
+ * list variables in the LLM environment
3941
+ */
3942
+ variables = async () => {
3943
+ const ctx = this._ctx.select("variables").select("id");
3944
+ const response = await ctx.execute();
3945
+ return response.map((r) => new Client(ctx.copy()).loadLLMVariableFromID(r.id));
3946
+ };
3947
+ /**
3948
+ * Set a variable of type CacheVolume in the llm environment
3949
+ * @param value The CacheVolume value to assign to the variable
3950
+ * @deprecated use set<TargetType> instead
3951
+ */
3952
+ withCacheVolume = (value) => {
3953
+ const ctx = this._ctx.select("withCacheVolume", { value });
3954
+ return new LLM(ctx);
3955
+ };
3956
+ /**
3957
+ * Set a variable of type Container in the llm environment
3958
+ * @param value The Container value to assign to the variable
3959
+ * @deprecated use set<TargetType> instead
3960
+ */
3961
+ withContainer = (value) => {
3962
+ const ctx = this._ctx.select("withContainer", { value });
3963
+ return new LLM(ctx);
3964
+ };
3965
+ /**
3966
+ * Set a variable of type CurrentModule in the llm environment
3967
+ * @param value The CurrentModule value to assign to the variable
3968
+ * @deprecated use set<TargetType> instead
3969
+ */
3970
+ withCurrentModule = (value) => {
3971
+ const ctx = this._ctx.select("withCurrentModule", { value });
3972
+ return new LLM(ctx);
3973
+ };
3974
+ /**
3975
+ * Set a variable of type Directory in the llm environment
3976
+ * @param value The Directory value to assign to the variable
3977
+ * @deprecated use set<TargetType> instead
3978
+ */
3979
+ withDirectory = (value) => {
3980
+ const ctx = this._ctx.select("withDirectory", { value });
3981
+ return new LLM(ctx);
3982
+ };
3983
+ /**
3984
+ * Set a variable of type EnumTypeDef in the llm environment
3985
+ * @param value The EnumTypeDef value to assign to the variable
3986
+ * @deprecated use set<TargetType> instead
3987
+ */
3988
+ withEnumTypeDef = (value) => {
3989
+ const ctx = this._ctx.select("withEnumTypeDef", { value });
3990
+ return new LLM(ctx);
3991
+ };
3992
+ /**
3993
+ * Set a variable of type EnumValueTypeDef in the llm environment
3994
+ * @param value The EnumValueTypeDef value to assign to the variable
3995
+ * @deprecated use set<TargetType> instead
3996
+ */
3997
+ withEnumValueTypeDef = (value) => {
3998
+ const ctx = this._ctx.select("withEnumValueTypeDef", { value });
3999
+ return new LLM(ctx);
4000
+ };
4001
+ /**
4002
+ * Set a variable of type Error in the llm environment
4003
+ * @param value The Error value to assign to the variable
4004
+ * @deprecated use set<TargetType> instead
4005
+ */
4006
+ withError = (value) => {
4007
+ const ctx = this._ctx.select("withError", { value });
4008
+ return new LLM(ctx);
4009
+ };
4010
+ /**
4011
+ * Set a variable of type ErrorValue in the llm environment
4012
+ * @param value The ErrorValue value to assign to the variable
4013
+ * @deprecated use set<TargetType> instead
4014
+ */
4015
+ withErrorValue = (value) => {
4016
+ const ctx = this._ctx.select("withErrorValue", { value });
4017
+ return new LLM(ctx);
4018
+ };
4019
+ /**
4020
+ * Set a variable of type FieldTypeDef in the llm environment
4021
+ * @param value The FieldTypeDef value to assign to the variable
4022
+ * @deprecated use set<TargetType> instead
4023
+ */
4024
+ withFieldTypeDef = (value) => {
4025
+ const ctx = this._ctx.select("withFieldTypeDef", { value });
4026
+ return new LLM(ctx);
4027
+ };
4028
+ /**
4029
+ * Set a variable of type File in the llm environment
4030
+ * @param value The File value to assign to the variable
4031
+ * @deprecated use set<TargetType> instead
4032
+ */
4033
+ withFile = (value) => {
4034
+ const ctx = this._ctx.select("withFile", { value });
4035
+ return new LLM(ctx);
4036
+ };
4037
+ /**
4038
+ * Set a variable of type Function in the llm environment
4039
+ * @param value The Function value to assign to the variable
4040
+ * @deprecated use set<TargetType> instead
4041
+ */
4042
+ withFunction = (value) => {
4043
+ const ctx = this._ctx.select("withFunction", { value });
4044
+ return new LLM(ctx);
4045
+ };
4046
+ /**
4047
+ * Set a variable of type FunctionArg in the llm environment
4048
+ * @param value The FunctionArg value to assign to the variable
4049
+ * @deprecated use set<TargetType> instead
4050
+ */
4051
+ withFunctionArg = (value) => {
4052
+ const ctx = this._ctx.select("withFunctionArg", { value });
4053
+ return new LLM(ctx);
4054
+ };
4055
+ /**
4056
+ * Set a variable of type FunctionCall in the llm environment
4057
+ * @param value The FunctionCall value to assign to the variable
4058
+ * @deprecated use set<TargetType> instead
4059
+ */
4060
+ withFunctionCall = (value) => {
4061
+ const ctx = this._ctx.select("withFunctionCall", { value });
4062
+ return new LLM(ctx);
4063
+ };
4064
+ /**
4065
+ * Set a variable of type FunctionCallArgValue in the llm environment
4066
+ * @param value The FunctionCallArgValue value to assign to the variable
4067
+ * @deprecated use set<TargetType> instead
4068
+ */
4069
+ withFunctionCallArgValue = (value) => {
4070
+ const ctx = this._ctx.select("withFunctionCallArgValue", { value });
4071
+ return new LLM(ctx);
4072
+ };
4073
+ /**
4074
+ * Set a variable of type GeneratedCode in the llm environment
4075
+ * @param value The GeneratedCode value to assign to the variable
4076
+ * @deprecated use set<TargetType> instead
4077
+ */
4078
+ withGeneratedCode = (value) => {
4079
+ const ctx = this._ctx.select("withGeneratedCode", { value });
4080
+ return new LLM(ctx);
4081
+ };
4082
+ /**
4083
+ * Set a variable of type GitRef in the llm environment
4084
+ * @param value The GitRef value to assign to the variable
4085
+ * @deprecated use set<TargetType> instead
4086
+ */
4087
+ withGitRef = (value) => {
4088
+ const ctx = this._ctx.select("withGitRef", { value });
4089
+ return new LLM(ctx);
4090
+ };
4091
+ /**
4092
+ * Set a variable of type GitRepository in the llm environment
4093
+ * @param value The GitRepository value to assign to the variable
4094
+ * @deprecated use set<TargetType> instead
4095
+ */
4096
+ withGitRepository = (value) => {
4097
+ const ctx = this._ctx.select("withGitRepository", { value });
4098
+ return new LLM(ctx);
4099
+ };
4100
+ /**
4101
+ * Set a variable of type InputTypeDef in the llm environment
4102
+ * @param value The InputTypeDef value to assign to the variable
4103
+ * @deprecated use set<TargetType> instead
4104
+ */
4105
+ withInputTypeDef = (value) => {
4106
+ const ctx = this._ctx.select("withInputTypeDef", { value });
4107
+ return new LLM(ctx);
4108
+ };
4109
+ /**
4110
+ * Set a variable of type InterfaceTypeDef in the llm environment
4111
+ * @param value The InterfaceTypeDef value to assign to the variable
4112
+ * @deprecated use set<TargetType> instead
4113
+ */
4114
+ withInterfaceTypeDef = (value) => {
4115
+ const ctx = this._ctx.select("withInterfaceTypeDef", { value });
4116
+ return new LLM(ctx);
4117
+ };
4118
+ /**
4119
+ * Set a variable of type LLM in the llm environment
4120
+ * @param value The LLM value to assign to the variable
4121
+ * @deprecated use set<TargetType> instead
4122
+ */
4123
+ withLLM = (value) => {
4124
+ const ctx = this._ctx.select("withLLM", { value });
4125
+ return new LLM(ctx);
4126
+ };
4127
+ /**
4128
+ * Set a variable of type ListTypeDef in the llm environment
4129
+ * @param value The ListTypeDef value to assign to the variable
4130
+ * @deprecated use set<TargetType> instead
4131
+ */
4132
+ withListTypeDef = (value) => {
4133
+ const ctx = this._ctx.select("withListTypeDef", { value });
4134
+ return new LLM(ctx);
4135
+ };
4136
+ /**
4137
+ * swap out the llm model
4138
+ * @param model The model to use
4139
+ */
4140
+ withModel = (model) => {
4141
+ const ctx = this._ctx.select("withModel", { model });
4142
+ return new LLM(ctx);
4143
+ };
4144
+ /**
4145
+ * Set a variable of type Module in the llm environment
4146
+ * @param value The Module value to assign to the variable
4147
+ * @deprecated use set<TargetType> instead
4148
+ */
4149
+ withModule = (value) => {
4150
+ const ctx = this._ctx.select("withModule", { value });
4151
+ return new LLM(ctx);
4152
+ };
4153
+ /**
4154
+ * Set a variable of type ModuleConfigClient in the llm environment
4155
+ * @param value The ModuleConfigClient value to assign to the variable
4156
+ * @deprecated use set<TargetType> instead
4157
+ */
4158
+ withModuleConfigClient = (value) => {
4159
+ const ctx = this._ctx.select("withModuleConfigClient", { value });
4160
+ return new LLM(ctx);
4161
+ };
4162
+ /**
4163
+ * Set a variable of type ModuleSource in the llm environment
4164
+ * @param value The ModuleSource value to assign to the variable
4165
+ * @deprecated use set<TargetType> instead
4166
+ */
4167
+ withModuleSource = (value) => {
4168
+ const ctx = this._ctx.select("withModuleSource", { value });
4169
+ return new LLM(ctx);
4170
+ };
4171
+ /**
4172
+ * Set a variable of type ObjectTypeDef in the llm environment
4173
+ * @param value The ObjectTypeDef value to assign to the variable
4174
+ * @deprecated use set<TargetType> instead
4175
+ */
4176
+ withObjectTypeDef = (value) => {
4177
+ const ctx = this._ctx.select("withObjectTypeDef", { value });
4178
+ return new LLM(ctx);
4179
+ };
4180
+ /**
4181
+ * append a prompt to the llm context
4182
+ * @param prompt The prompt to send
4183
+ */
4184
+ withPrompt = (prompt) => {
4185
+ const ctx = this._ctx.select("withPrompt", { prompt });
4186
+ return new LLM(ctx);
4187
+ };
4188
+ /**
4189
+ * append the contents of a file to the llm context
4190
+ * @param file The file to read the prompt from
4191
+ */
4192
+ withPromptFile = (file) => {
4193
+ const ctx = this._ctx.select("withPromptFile", { file });
4194
+ return new LLM(ctx);
4195
+ };
4196
+ /**
4197
+ * Add a string variable to the LLM's environment
4198
+ * @param name The variable name
4199
+ * @param value The variable value
4200
+ */
4201
+ withPromptVar = (name, value) => {
4202
+ const ctx = this._ctx.select("withPromptVar", { name, value });
4203
+ return new LLM(ctx);
4204
+ };
4205
+ /**
4206
+ * Set a variable of type SDKConfig in the llm environment
4207
+ * @param value The SDKConfig value to assign to the variable
4208
+ * @deprecated use set<TargetType> instead
4209
+ */
4210
+ withSDKConfig = (value) => {
4211
+ const ctx = this._ctx.select("withSDKConfig", { value });
4212
+ return new LLM(ctx);
4213
+ };
4214
+ /**
4215
+ * Set a variable of type ScalarTypeDef in the llm environment
4216
+ * @param value The ScalarTypeDef value to assign to the variable
4217
+ * @deprecated use set<TargetType> instead
4218
+ */
4219
+ withScalarTypeDef = (value) => {
4220
+ const ctx = this._ctx.select("withScalarTypeDef", { value });
4221
+ return new LLM(ctx);
4222
+ };
4223
+ /**
4224
+ * Set a variable of type Secret in the llm environment
4225
+ * @param value The Secret value to assign to the variable
4226
+ * @deprecated use set<TargetType> instead
4227
+ */
4228
+ withSecret = (value) => {
4229
+ const ctx = this._ctx.select("withSecret", { value });
4230
+ return new LLM(ctx);
4231
+ };
4232
+ /**
4233
+ * Set a variable of type Service in the llm environment
4234
+ * @param value The Service value to assign to the variable
4235
+ * @deprecated use set<TargetType> instead
4236
+ */
4237
+ withService = (value) => {
4238
+ const ctx = this._ctx.select("withService", { value });
4239
+ return new LLM(ctx);
4240
+ };
4241
+ /**
4242
+ * Set a variable of type Socket in the llm environment
4243
+ * @param value The Socket value to assign to the variable
4244
+ * @deprecated use set<TargetType> instead
4245
+ */
4246
+ withSocket = (value) => {
4247
+ const ctx = this._ctx.select("withSocket", { value });
4248
+ return new LLM(ctx);
4249
+ };
4250
+ /**
4251
+ * Set a variable of type SourceMap in the llm environment
4252
+ * @param value The SourceMap value to assign to the variable
4253
+ * @deprecated use set<TargetType> instead
4254
+ */
4255
+ withSourceMap = (value) => {
4256
+ const ctx = this._ctx.select("withSourceMap", { value });
4257
+ return new LLM(ctx);
4258
+ };
4259
+ /**
4260
+ * Set a variable of type Terminal in the llm environment
4261
+ * @param value The Terminal value to assign to the variable
4262
+ * @deprecated use set<TargetType> instead
4263
+ */
4264
+ withTerminal = (value) => {
4265
+ const ctx = this._ctx.select("withTerminal", { value });
4266
+ return new LLM(ctx);
4267
+ };
4268
+ /**
4269
+ * Set a variable of type TypeDef in the llm environment
4270
+ * @param value The TypeDef value to assign to the variable
4271
+ * @deprecated use set<TargetType> instead
4272
+ */
4273
+ withTypeDef = (value) => {
4274
+ const ctx = this._ctx.select("withTypeDef", { value });
4275
+ return new LLM(ctx);
4276
+ };
4277
+ /**
4278
+ * Call the provided function with current LLM.
4279
+ *
4280
+ * This is useful for reusability and readability by not breaking the calling chain.
4281
+ */
4282
+ with = (arg) => {
4283
+ return arg(this);
4284
+ };
4285
+ }
4286
+ export class LLMVariable extends BaseClient {
4287
+ _id = undefined;
4288
+ _hash = undefined;
4289
+ _name = undefined;
4290
+ _typeName = undefined;
4291
+ /**
4292
+ * Constructor is used for internal usage only, do not create object from it.
4293
+ */
4294
+ constructor(ctx, _id, _hash, _name, _typeName) {
4295
+ super(ctx);
4296
+ this._id = _id;
4297
+ this._hash = _hash;
4298
+ this._name = _name;
4299
+ this._typeName = _typeName;
4300
+ }
4301
+ /**
4302
+ * A unique identifier for this LLMVariable.
4303
+ */
4304
+ id = async () => {
4305
+ if (this._id) {
4306
+ return this._id;
4307
+ }
4308
+ const ctx = this._ctx.select("id");
4309
+ const response = await ctx.execute();
4310
+ return response;
4311
+ };
4312
+ hash = async () => {
4313
+ if (this._hash) {
4314
+ return this._hash;
4315
+ }
4316
+ const ctx = this._ctx.select("hash");
4317
+ const response = await ctx.execute();
4318
+ return response;
4319
+ };
4320
+ name = async () => {
4321
+ if (this._name) {
4322
+ return this._name;
4323
+ }
4324
+ const ctx = this._ctx.select("name");
4325
+ const response = await ctx.execute();
4326
+ return response;
4327
+ };
4328
+ typeName = async () => {
4329
+ if (this._typeName) {
4330
+ return this._typeName;
4331
+ }
4332
+ const ctx = this._ctx.select("typeName");
4333
+ const response = await ctx.execute();
4334
+ return response;
4335
+ };
4336
+ }
4337
+ /**
4338
+ * A simple key value object that represents a label.
4339
+ */
4340
+ export class Label extends BaseClient {
4341
+ _id = undefined;
4342
+ _name = undefined;
4343
+ _value = undefined;
4344
+ /**
4345
+ * Constructor is used for internal usage only, do not create object from it.
4346
+ */
4347
+ constructor(ctx, _id, _name, _value) {
4348
+ super(ctx);
4349
+ this._id = _id;
4350
+ this._name = _name;
4351
+ this._value = _value;
4352
+ }
4353
+ /**
4354
+ * A unique identifier for this Label.
4355
+ */
4356
+ id = async () => {
4357
+ if (this._id) {
4358
+ return this._id;
4359
+ }
4360
+ const ctx = this._ctx.select("id");
4361
+ const response = await ctx.execute();
4362
+ return response;
4363
+ };
4364
+ /**
4365
+ * The label name.
4366
+ */
4367
+ name = async () => {
4368
+ if (this._name) {
4369
+ return this._name;
4370
+ }
4371
+ const ctx = this._ctx.select("name");
4372
+ const response = await ctx.execute();
4373
+ return response;
4374
+ };
4375
+ /**
4376
+ * The label value.
4377
+ */
4378
+ value = async () => {
4379
+ if (this._value) {
4380
+ return this._value;
4381
+ }
4382
+ const ctx = this._ctx.select("value");
4383
+ const response = await ctx.execute();
4384
+ return response;
4385
+ };
4386
+ }
4387
+ /**
4388
+ * A definition of a list type in a Module.
4389
+ */
4390
+ export class ListTypeDef extends BaseClient {
4391
+ _id = undefined;
4392
+ /**
4393
+ * Constructor is used for internal usage only, do not create object from it.
4394
+ */
4395
+ constructor(ctx, _id) {
4396
+ super(ctx);
4397
+ this._id = _id;
4398
+ }
4399
+ /**
4400
+ * A unique identifier for this ListTypeDef.
4401
+ */
4402
+ id = async () => {
4403
+ if (this._id) {
4404
+ return this._id;
4405
+ }
4406
+ const ctx = this._ctx.select("id");
4407
+ const response = await ctx.execute();
4408
+ return response;
4409
+ };
4410
+ /**
4411
+ * The type of the elements in the list.
4412
+ */
4413
+ elementTypeDef = () => {
4414
+ const ctx = this._ctx.select("elementTypeDef");
4415
+ return new TypeDef(ctx);
4416
+ };
4417
+ }
4418
+ /**
4419
+ * A Dagger module.
4420
+ */
4421
+ export class Module_ extends BaseClient {
4422
+ _id = undefined;
4423
+ _description = undefined;
4424
+ _name = undefined;
4425
+ _serve = undefined;
4426
+ _sync = undefined;
4427
+ /**
4428
+ * Constructor is used for internal usage only, do not create object from it.
4429
+ */
4430
+ constructor(ctx, _id, _description, _name, _serve, _sync) {
4431
+ super(ctx);
4432
+ this._id = _id;
4433
+ this._description = _description;
4434
+ this._name = _name;
4435
+ this._serve = _serve;
4436
+ this._sync = _sync;
4437
+ }
4438
+ /**
4439
+ * A unique identifier for this Module.
4440
+ */
4441
+ id = async () => {
4442
+ if (this._id) {
4443
+ return this._id;
4444
+ }
4445
+ const ctx = this._ctx.select("id");
4446
+ const response = await ctx.execute();
4447
+ return response;
4448
+ };
4449
+ /**
4450
+ * The dependencies of the module.
4451
+ */
4452
+ dependencies = async () => {
4453
+ const ctx = this._ctx.select("dependencies").select("id");
4454
+ const response = await ctx.execute();
4455
+ return response.map((r) => new Client(ctx.copy()).loadModuleFromID(r.id));
4456
+ };
4457
+ /**
4458
+ * The doc string of the module, if any
4459
+ */
4460
+ description = async () => {
4461
+ if (this._description) {
4462
+ return this._description;
4463
+ }
4464
+ const ctx = this._ctx.select("description");
4465
+ const response = await ctx.execute();
4466
+ return response;
4467
+ };
4468
+ /**
4469
+ * Enumerations served by this module.
4470
+ */
4471
+ enums = async () => {
4472
+ const ctx = this._ctx.select("enums").select("id");
4473
+ const response = await ctx.execute();
4474
+ return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
4475
+ };
4476
+ /**
4477
+ * The generated files and directories made on top of the module source's context directory.
4478
+ */
4479
+ generatedContextDirectory = () => {
4480
+ const ctx = this._ctx.select("generatedContextDirectory");
4481
+ return new Directory(ctx);
4482
+ };
4483
+ /**
4484
+ * Interfaces served by this module.
4485
+ */
4486
+ interfaces = async () => {
4487
+ const ctx = this._ctx.select("interfaces").select("id");
4488
+ const response = await ctx.execute();
4489
+ return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
4490
+ };
4491
+ /**
4492
+ * The name of the module
4493
+ */
4494
+ name = async () => {
4495
+ if (this._name) {
4496
+ return this._name;
4497
+ }
4498
+ const ctx = this._ctx.select("name");
4499
+ const response = await ctx.execute();
4500
+ return response;
4501
+ };
4502
+ /**
4503
+ * Objects served by this module.
4504
+ */
4505
+ objects = async () => {
4506
+ const ctx = this._ctx.select("objects").select("id");
4507
+ const response = await ctx.execute();
4508
+ return response.map((r) => new Client(ctx.copy()).loadTypeDefFromID(r.id));
4509
+ };
4510
+ /**
4511
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
4512
+ */
4513
+ runtime = () => {
4514
+ const ctx = this._ctx.select("runtime");
4515
+ return new Container(ctx);
4516
+ };
4517
+ /**
4518
+ * The SDK config used by this module.
4519
+ */
4520
+ sdk = () => {
4521
+ const ctx = this._ctx.select("sdk");
4522
+ return new SDKConfig(ctx);
4523
+ };
4524
+ /**
4525
+ * Serve a module's API in the current session.
4526
+ *
4527
+ * Note: this can only be called once per session. In the future, it could return a stream or service to remove the side effect.
4528
+ */
4529
+ serve = async () => {
4530
+ if (this._serve) {
4531
+ return;
4532
+ }
4533
+ const ctx = this._ctx.select("serve");
4534
+ await ctx.execute();
4535
+ };
4536
+ /**
4537
+ * The source for the module.
4538
+ */
4539
+ source = () => {
4540
+ const ctx = this._ctx.select("source");
4541
+ return new ModuleSource(ctx);
4542
+ };
4543
+ /**
4544
+ * Forces evaluation of the module, including any loading into the engine and associated validation.
4545
+ */
4546
+ sync = async () => {
4547
+ const ctx = this._ctx.select("sync");
4548
+ const response = await ctx.execute();
4549
+ return new Client(ctx.copy()).loadModuleFromID(response);
4550
+ };
4551
+ /**
4552
+ * Retrieves the module with the given description
4553
+ * @param description The description to set
4554
+ */
4555
+ withDescription = (description) => {
4556
+ const ctx = this._ctx.select("withDescription", { description });
4557
+ return new Module_(ctx);
4558
+ };
4559
+ /**
4560
+ * This module plus the given Enum type and associated values
4561
+ */
4562
+ withEnum = (enum_) => {
4563
+ const ctx = this._ctx.select("withEnum", {
4564
+ enum: enum_,
4565
+ });
4566
+ return new Module_(ctx);
4567
+ };
4568
+ /**
4569
+ * This module plus the given Interface type and associated functions
4570
+ */
4571
+ withInterface = (iface) => {
4572
+ const ctx = this._ctx.select("withInterface", { iface });
4573
+ return new Module_(ctx);
4574
+ };
4575
+ /**
4576
+ * This module plus the given Object type and associated functions.
4577
+ */
4578
+ withObject = (object) => {
4579
+ const ctx = this._ctx.select("withObject", { object });
4580
+ return new Module_(ctx);
4581
+ };
4582
+ /**
4583
+ * Call the provided function with current Module.
4584
+ *
3149
4585
  * This is useful for reusability and readability by not breaking the calling chain.
3150
4586
  */
3151
4587
  with = (arg) => {
3152
4588
  return arg(this);
3153
4589
  };
3154
4590
  }
4591
+ /**
4592
+ * The client generated for the module.
4593
+ */
4594
+ export class ModuleConfigClient extends BaseClient {
4595
+ _id = undefined;
4596
+ _dev = undefined;
4597
+ _directory = undefined;
4598
+ _generator = undefined;
4599
+ /**
4600
+ * Constructor is used for internal usage only, do not create object from it.
4601
+ */
4602
+ constructor(ctx, _id, _dev, _directory, _generator) {
4603
+ super(ctx);
4604
+ this._id = _id;
4605
+ this._dev = _dev;
4606
+ this._directory = _directory;
4607
+ this._generator = _generator;
4608
+ }
4609
+ /**
4610
+ * A unique identifier for this ModuleConfigClient.
4611
+ */
4612
+ id = async () => {
4613
+ if (this._id) {
4614
+ return this._id;
4615
+ }
4616
+ const ctx = this._ctx.select("id");
4617
+ const response = await ctx.execute();
4618
+ return response;
4619
+ };
4620
+ /**
4621
+ * If true, generate the client in developer mode.
4622
+ */
4623
+ dev = async () => {
4624
+ if (this._dev) {
4625
+ return this._dev;
4626
+ }
4627
+ const ctx = this._ctx.select("dev");
4628
+ const response = await ctx.execute();
4629
+ return response;
4630
+ };
4631
+ /**
4632
+ * The directory the client is generated in.
4633
+ */
4634
+ directory = async () => {
4635
+ if (this._directory) {
4636
+ return this._directory;
4637
+ }
4638
+ const ctx = this._ctx.select("directory");
4639
+ const response = await ctx.execute();
4640
+ return response;
4641
+ };
4642
+ /**
4643
+ * The generator to use
4644
+ */
4645
+ generator = async () => {
4646
+ if (this._generator) {
4647
+ return this._generator;
4648
+ }
4649
+ const ctx = this._ctx.select("generator");
4650
+ const response = await ctx.execute();
4651
+ return response;
4652
+ };
4653
+ }
3155
4654
  /**
3156
4655
  * The source needed to load and run a module, along with any metadata about the source such as versions/urls/etc.
3157
4656
  */
@@ -3169,6 +4668,7 @@ export class ModuleSource extends BaseClient {
3169
4668
  _localContextDirectoryPath = undefined;
3170
4669
  _moduleName = undefined;
3171
4670
  _moduleOriginalName = undefined;
4671
+ _originalSubpath = undefined;
3172
4672
  _pin = undefined;
3173
4673
  _repoRootPath = undefined;
3174
4674
  _sourceRootSubpath = undefined;
@@ -3178,7 +4678,7 @@ export class ModuleSource extends BaseClient {
3178
4678
  /**
3179
4679
  * Constructor is used for internal usage only, do not create object from it.
3180
4680
  */
3181
- constructor(ctx, _id, _asString, _cloneRef, _commit, _configExists, _digest, _engineVersion, _htmlRepoURL, _htmlURL, _kind, _localContextDirectoryPath, _moduleName, _moduleOriginalName, _pin, _repoRootPath, _sourceRootSubpath, _sourceSubpath, _sync, _version) {
4681
+ constructor(ctx, _id, _asString, _cloneRef, _commit, _configExists, _digest, _engineVersion, _htmlRepoURL, _htmlURL, _kind, _localContextDirectoryPath, _moduleName, _moduleOriginalName, _originalSubpath, _pin, _repoRootPath, _sourceRootSubpath, _sourceSubpath, _sync, _version) {
3182
4682
  super(ctx);
3183
4683
  this._id = _id;
3184
4684
  this._asString = _asString;
@@ -3193,6 +4693,7 @@ export class ModuleSource extends BaseClient {
3193
4693
  this._localContextDirectoryPath = _localContextDirectoryPath;
3194
4694
  this._moduleName = _moduleName;
3195
4695
  this._moduleOriginalName = _moduleOriginalName;
4696
+ this._originalSubpath = _originalSubpath;
3196
4697
  this._pin = _pin;
3197
4698
  this._repoRootPath = _repoRootPath;
3198
4699
  this._sourceRootSubpath = _sourceRootSubpath;
@@ -3251,6 +4752,14 @@ export class ModuleSource extends BaseClient {
3251
4752
  const response = await ctx.execute();
3252
4753
  return response;
3253
4754
  };
4755
+ /**
4756
+ * The clients generated for the module.
4757
+ */
4758
+ configClients = async () => {
4759
+ const ctx = this._ctx.select("configClients").select("id");
4760
+ const response = await ctx.execute();
4761
+ return response.map((r) => new Client(ctx.copy()).loadModuleConfigClientFromID(r.id));
4762
+ };
3254
4763
  /**
3255
4764
  * Whether an existing dagger.json for the module was found.
3256
4765
  */
@@ -3380,6 +4889,17 @@ export class ModuleSource extends BaseClient {
3380
4889
  const response = await ctx.execute();
3381
4890
  return response;
3382
4891
  };
4892
+ /**
4893
+ * The original subpath used when instantiating this module source, relative to the context directory.
4894
+ */
4895
+ originalSubpath = async () => {
4896
+ if (this._originalSubpath) {
4897
+ return this._originalSubpath;
4898
+ }
4899
+ const ctx = this._ctx.select("originalSubpath");
4900
+ const response = await ctx.execute();
4901
+ return response;
4902
+ };
3383
4903
  /**
3384
4904
  * The pinned version of this module source.
3385
4905
  */
@@ -3450,6 +4970,20 @@ export class ModuleSource extends BaseClient {
3450
4970
  const response = await ctx.execute();
3451
4971
  return response;
3452
4972
  };
4973
+ /**
4974
+ * Update the module source with a new client to generate.
4975
+ * @param generator The generator to use
4976
+ * @param outputDir The output directory for the generated client.
4977
+ * @param opts.dev Generate in developer mode
4978
+ */
4979
+ withClient = (generator, outputDir, opts) => {
4980
+ const ctx = this._ctx.select("withClient", {
4981
+ generator,
4982
+ outputDir,
4983
+ ...opts,
4984
+ });
4985
+ return new ModuleSource(ctx);
4986
+ };
3453
4987
  /**
3454
4988
  * Append the provided dependencies to the module source's dependency list.
3455
4989
  * @param dependencies The dependencies to append.
@@ -3840,6 +5374,15 @@ export class Client extends BaseClient {
3840
5374
  const ctx = this._ctx.select("http", { url, ...opts });
3841
5375
  return new File(ctx);
3842
5376
  };
5377
+ /**
5378
+ * Initialize a Large Language Model (LLM)
5379
+ * @param opts.model Model to use
5380
+ * @param opts.maxAPICalls Cap the number of API calls for this LLM
5381
+ */
5382
+ llm = (opts) => {
5383
+ const ctx = this._ctx.select("llm", { ...opts });
5384
+ return new LLM(ctx);
5385
+ };
3843
5386
  /**
3844
5387
  * Load a CacheVolume from its ID.
3845
5388
  */
@@ -3924,6 +5467,13 @@ export class Client extends BaseClient {
3924
5467
  const ctx = this._ctx.select("loadErrorFromID", { id });
3925
5468
  return new Error(ctx);
3926
5469
  };
5470
+ /**
5471
+ * Load a ErrorValue from its ID.
5472
+ */
5473
+ loadErrorValueFromID = (id) => {
5474
+ const ctx = this._ctx.select("loadErrorValueFromID", { id });
5475
+ return new ErrorValue(ctx);
5476
+ };
3927
5477
  /**
3928
5478
  * Load a FieldTypeDef from its ID.
3929
5479
  */
@@ -4008,6 +5558,20 @@ export class Client extends BaseClient {
4008
5558
  const ctx = this._ctx.select("loadInterfaceTypeDefFromID", { id });
4009
5559
  return new InterfaceTypeDef(ctx);
4010
5560
  };
5561
+ /**
5562
+ * Load a LLM from its ID.
5563
+ */
5564
+ loadLLMFromID = (id) => {
5565
+ const ctx = this._ctx.select("loadLLMFromID", { id });
5566
+ return new LLM(ctx);
5567
+ };
5568
+ /**
5569
+ * Load a LLMVariable from its ID.
5570
+ */
5571
+ loadLLMVariableFromID = (id) => {
5572
+ const ctx = this._ctx.select("loadLLMVariableFromID", { id });
5573
+ return new LLMVariable(ctx);
5574
+ };
4011
5575
  /**
4012
5576
  * Load a Label from its ID.
4013
5577
  */
@@ -4022,6 +5586,13 @@ export class Client extends BaseClient {
4022
5586
  const ctx = this._ctx.select("loadListTypeDefFromID", { id });
4023
5587
  return new ListTypeDef(ctx);
4024
5588
  };
5589
+ /**
5590
+ * Load a ModuleConfigClient from its ID.
5591
+ */
5592
+ loadModuleConfigClientFromID = (id) => {
5593
+ const ctx = this._ctx.select("loadModuleConfigClientFromID", { id });
5594
+ return new ModuleConfigClient(ctx);
5595
+ };
4025
5596
  /**
4026
5597
  * Load a Module from its ID.
4027
5598
  */