@dagger.io/dagger 0.17.2 → 0.18.1

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.
@@ -143,6 +143,164 @@ export var TypeDefKind;
143
143
  */
144
144
  TypeDefKind["VoidKind"] = "VOID_KIND";
145
145
  })(TypeDefKind || (TypeDefKind = {}));
146
+ export class Binding extends BaseClient {
147
+ _id = undefined;
148
+ _digest = undefined;
149
+ _name = undefined;
150
+ _typeName = undefined;
151
+ /**
152
+ * Constructor is used for internal usage only, do not create object from it.
153
+ */
154
+ constructor(ctx, _id, _digest, _name, _typeName) {
155
+ super(ctx);
156
+ this._id = _id;
157
+ this._digest = _digest;
158
+ this._name = _name;
159
+ this._typeName = _typeName;
160
+ }
161
+ /**
162
+ * A unique identifier for this Binding.
163
+ */
164
+ id = async () => {
165
+ if (this._id) {
166
+ return this._id;
167
+ }
168
+ const ctx = this._ctx.select("id");
169
+ const response = await ctx.execute();
170
+ return response;
171
+ };
172
+ /**
173
+ * Retrieve the binding value, as type CacheVolume
174
+ */
175
+ asCacheVolume = () => {
176
+ const ctx = this._ctx.select("asCacheVolume");
177
+ return new CacheVolume(ctx);
178
+ };
179
+ /**
180
+ * Retrieve the binding value, as type Container
181
+ */
182
+ asContainer = () => {
183
+ const ctx = this._ctx.select("asContainer");
184
+ return new Container(ctx);
185
+ };
186
+ /**
187
+ * Retrieve the binding value, as type Directory
188
+ */
189
+ asDirectory = () => {
190
+ const ctx = this._ctx.select("asDirectory");
191
+ return new Directory(ctx);
192
+ };
193
+ /**
194
+ * Retrieve the binding value, as type Env
195
+ */
196
+ asEnv = () => {
197
+ const ctx = this._ctx.select("asEnv");
198
+ return new Env(ctx);
199
+ };
200
+ /**
201
+ * Retrieve the binding value, as type File
202
+ */
203
+ asFile = () => {
204
+ const ctx = this._ctx.select("asFile");
205
+ return new File(ctx);
206
+ };
207
+ /**
208
+ * Retrieve the binding value, as type GitRef
209
+ */
210
+ asGitRef = () => {
211
+ const ctx = this._ctx.select("asGitRef");
212
+ return new GitRef(ctx);
213
+ };
214
+ /**
215
+ * Retrieve the binding value, as type GitRepository
216
+ */
217
+ asGitRepository = () => {
218
+ const ctx = this._ctx.select("asGitRepository");
219
+ return new GitRepository(ctx);
220
+ };
221
+ /**
222
+ * Retrieve the binding value, as type LLM
223
+ */
224
+ asLLM = () => {
225
+ const ctx = this._ctx.select("asLLM");
226
+ return new LLM(ctx);
227
+ };
228
+ /**
229
+ * Retrieve the binding value, as type Module
230
+ */
231
+ asModule = () => {
232
+ const ctx = this._ctx.select("asModule");
233
+ return new Module_(ctx);
234
+ };
235
+ /**
236
+ * Retrieve the binding value, as type ModuleConfigClient
237
+ */
238
+ asModuleConfigClient = () => {
239
+ const ctx = this._ctx.select("asModuleConfigClient");
240
+ return new ModuleConfigClient(ctx);
241
+ };
242
+ /**
243
+ * Retrieve the binding value, as type ModuleSource
244
+ */
245
+ asModuleSource = () => {
246
+ const ctx = this._ctx.select("asModuleSource");
247
+ return new ModuleSource(ctx);
248
+ };
249
+ /**
250
+ * Retrieve the binding value, as type Secret
251
+ */
252
+ asSecret = () => {
253
+ const ctx = this._ctx.select("asSecret");
254
+ return new Secret(ctx);
255
+ };
256
+ /**
257
+ * Retrieve the binding value, as type Service
258
+ */
259
+ asService = () => {
260
+ const ctx = this._ctx.select("asService");
261
+ return new Service(ctx);
262
+ };
263
+ /**
264
+ * Retrieve the binding value, as type Socket
265
+ */
266
+ asSocket = () => {
267
+ const ctx = this._ctx.select("asSocket");
268
+ return new Socket(ctx);
269
+ };
270
+ /**
271
+ * The digest of the binding value
272
+ */
273
+ digest = async () => {
274
+ if (this._digest) {
275
+ return this._digest;
276
+ }
277
+ const ctx = this._ctx.select("digest");
278
+ const response = await ctx.execute();
279
+ return response;
280
+ };
281
+ /**
282
+ * The binding name
283
+ */
284
+ name = async () => {
285
+ if (this._name) {
286
+ return this._name;
287
+ }
288
+ const ctx = this._ctx.select("name");
289
+ const response = await ctx.execute();
290
+ return response;
291
+ };
292
+ /**
293
+ * The binding type
294
+ */
295
+ typeName = async () => {
296
+ if (this._typeName) {
297
+ return this._typeName;
298
+ }
299
+ const ctx = this._ctx.select("typeName");
300
+ const response = await ctx.execute();
301
+ return response;
302
+ };
303
+ }
146
304
  /**
147
305
  * A directory whose contents persist across runs.
148
306
  */
@@ -1850,6 +2008,397 @@ export class EnumValueTypeDef extends BaseClient {
1850
2008
  return new SourceMap(ctx);
1851
2009
  };
1852
2010
  }
2011
+ export class Env extends BaseClient {
2012
+ _id = undefined;
2013
+ /**
2014
+ * Constructor is used for internal usage only, do not create object from it.
2015
+ */
2016
+ constructor(ctx, _id) {
2017
+ super(ctx);
2018
+ this._id = _id;
2019
+ }
2020
+ /**
2021
+ * A unique identifier for this Env.
2022
+ */
2023
+ id = async () => {
2024
+ if (this._id) {
2025
+ return this._id;
2026
+ }
2027
+ const ctx = this._ctx.select("id");
2028
+ const response = await ctx.execute();
2029
+ return response;
2030
+ };
2031
+ /**
2032
+ * retrieve an input value by name
2033
+ */
2034
+ input = (name) => {
2035
+ const ctx = this._ctx.select("input", { name });
2036
+ return new Binding(ctx);
2037
+ };
2038
+ /**
2039
+ * return all input values for the environment
2040
+ */
2041
+ inputs = async () => {
2042
+ const ctx = this._ctx.select("inputs").select("id");
2043
+ const response = await ctx.execute();
2044
+ return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
2045
+ };
2046
+ /**
2047
+ * retrieve an output value by name
2048
+ */
2049
+ output = (name) => {
2050
+ const ctx = this._ctx.select("output", { name });
2051
+ return new Binding(ctx);
2052
+ };
2053
+ /**
2054
+ * return all output values for the environment
2055
+ */
2056
+ outputs = async () => {
2057
+ const ctx = this._ctx.select("outputs").select("id");
2058
+ const response = await ctx.execute();
2059
+ return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
2060
+ };
2061
+ /**
2062
+ * Create or update a binding of type CacheVolume in the environment
2063
+ * @param name The name of the binding
2064
+ * @param value The CacheVolume value to assign to the binding
2065
+ * @param description The purpose of the input
2066
+ */
2067
+ withCacheVolumeInput = (name, value, description) => {
2068
+ const ctx = this._ctx.select("withCacheVolumeInput", {
2069
+ name,
2070
+ value,
2071
+ description,
2072
+ });
2073
+ return new Env(ctx);
2074
+ };
2075
+ /**
2076
+ * Declare a desired CacheVolume output to be assigned in the environment
2077
+ * @param name The name of the binding
2078
+ * @param description A description of the desired value of the binding
2079
+ */
2080
+ withCacheVolumeOutput = (name, description) => {
2081
+ const ctx = this._ctx.select("withCacheVolumeOutput", { name, description });
2082
+ return new Env(ctx);
2083
+ };
2084
+ /**
2085
+ * Create or update a binding of type Container in the environment
2086
+ * @param name The name of the binding
2087
+ * @param value The Container value to assign to the binding
2088
+ * @param description The purpose of the input
2089
+ */
2090
+ withContainerInput = (name, value, description) => {
2091
+ const ctx = this._ctx.select("withContainerInput", {
2092
+ name,
2093
+ value,
2094
+ description,
2095
+ });
2096
+ return new Env(ctx);
2097
+ };
2098
+ /**
2099
+ * Declare a desired Container output to be assigned in the environment
2100
+ * @param name The name of the binding
2101
+ * @param description A description of the desired value of the binding
2102
+ */
2103
+ withContainerOutput = (name, description) => {
2104
+ const ctx = this._ctx.select("withContainerOutput", { name, description });
2105
+ return new Env(ctx);
2106
+ };
2107
+ /**
2108
+ * Create or update a binding of type Directory in the environment
2109
+ * @param name The name of the binding
2110
+ * @param value The Directory value to assign to the binding
2111
+ * @param description The purpose of the input
2112
+ */
2113
+ withDirectoryInput = (name, value, description) => {
2114
+ const ctx = this._ctx.select("withDirectoryInput", {
2115
+ name,
2116
+ value,
2117
+ description,
2118
+ });
2119
+ return new Env(ctx);
2120
+ };
2121
+ /**
2122
+ * Declare a desired Directory output to be assigned in the environment
2123
+ * @param name The name of the binding
2124
+ * @param description A description of the desired value of the binding
2125
+ */
2126
+ withDirectoryOutput = (name, description) => {
2127
+ const ctx = this._ctx.select("withDirectoryOutput", { name, description });
2128
+ return new Env(ctx);
2129
+ };
2130
+ /**
2131
+ * Create or update a binding of type Env in the environment
2132
+ * @param name The name of the binding
2133
+ * @param value The Env value to assign to the binding
2134
+ * @param description The purpose of the input
2135
+ */
2136
+ withEnvInput = (name, value, description) => {
2137
+ const ctx = this._ctx.select("withEnvInput", { name, value, description });
2138
+ return new Env(ctx);
2139
+ };
2140
+ /**
2141
+ * Declare a desired Env output to be assigned in the environment
2142
+ * @param name The name of the binding
2143
+ * @param description A description of the desired value of the binding
2144
+ */
2145
+ withEnvOutput = (name, description) => {
2146
+ const ctx = this._ctx.select("withEnvOutput", { name, description });
2147
+ return new Env(ctx);
2148
+ };
2149
+ /**
2150
+ * Create or update a binding of type File in the environment
2151
+ * @param name The name of the binding
2152
+ * @param value The File value to assign to the binding
2153
+ * @param description The purpose of the input
2154
+ */
2155
+ withFileInput = (name, value, description) => {
2156
+ const ctx = this._ctx.select("withFileInput", { name, value, description });
2157
+ return new Env(ctx);
2158
+ };
2159
+ /**
2160
+ * Declare a desired File output to be assigned in the environment
2161
+ * @param name The name of the binding
2162
+ * @param description A description of the desired value of the binding
2163
+ */
2164
+ withFileOutput = (name, description) => {
2165
+ const ctx = this._ctx.select("withFileOutput", { name, description });
2166
+ return new Env(ctx);
2167
+ };
2168
+ /**
2169
+ * Create or update a binding of type GitRef in the environment
2170
+ * @param name The name of the binding
2171
+ * @param value The GitRef value to assign to the binding
2172
+ * @param description The purpose of the input
2173
+ */
2174
+ withGitRefInput = (name, value, description) => {
2175
+ const ctx = this._ctx.select("withGitRefInput", {
2176
+ name,
2177
+ value,
2178
+ description,
2179
+ });
2180
+ return new Env(ctx);
2181
+ };
2182
+ /**
2183
+ * Declare a desired GitRef output to be assigned in the environment
2184
+ * @param name The name of the binding
2185
+ * @param description A description of the desired value of the binding
2186
+ */
2187
+ withGitRefOutput = (name, description) => {
2188
+ const ctx = this._ctx.select("withGitRefOutput", { name, description });
2189
+ return new Env(ctx);
2190
+ };
2191
+ /**
2192
+ * Create or update a binding of type GitRepository in the environment
2193
+ * @param name The name of the binding
2194
+ * @param value The GitRepository value to assign to the binding
2195
+ * @param description The purpose of the input
2196
+ */
2197
+ withGitRepositoryInput = (name, value, description) => {
2198
+ const ctx = this._ctx.select("withGitRepositoryInput", {
2199
+ name,
2200
+ value,
2201
+ description,
2202
+ });
2203
+ return new Env(ctx);
2204
+ };
2205
+ /**
2206
+ * Declare a desired GitRepository output to be assigned in the environment
2207
+ * @param name The name of the binding
2208
+ * @param description A description of the desired value of the binding
2209
+ */
2210
+ withGitRepositoryOutput = (name, description) => {
2211
+ const ctx = this._ctx.select("withGitRepositoryOutput", {
2212
+ name,
2213
+ description,
2214
+ });
2215
+ return new Env(ctx);
2216
+ };
2217
+ /**
2218
+ * Create or update a binding of type LLM in the environment
2219
+ * @param name The name of the binding
2220
+ * @param value The LLM value to assign to the binding
2221
+ * @param description The purpose of the input
2222
+ */
2223
+ withLLMInput = (name, value, description) => {
2224
+ const ctx = this._ctx.select("withLLMInput", { name, value, description });
2225
+ return new Env(ctx);
2226
+ };
2227
+ /**
2228
+ * Declare a desired LLM output to be assigned in the environment
2229
+ * @param name The name of the binding
2230
+ * @param description A description of the desired value of the binding
2231
+ */
2232
+ withLLMOutput = (name, description) => {
2233
+ const ctx = this._ctx.select("withLLMOutput", { name, description });
2234
+ return new Env(ctx);
2235
+ };
2236
+ /**
2237
+ * Create or update a binding of type ModuleConfigClient in the environment
2238
+ * @param name The name of the binding
2239
+ * @param value The ModuleConfigClient value to assign to the binding
2240
+ * @param description The purpose of the input
2241
+ */
2242
+ withModuleConfigClientInput = (name, value, description) => {
2243
+ const ctx = this._ctx.select("withModuleConfigClientInput", {
2244
+ name,
2245
+ value,
2246
+ description,
2247
+ });
2248
+ return new Env(ctx);
2249
+ };
2250
+ /**
2251
+ * Declare a desired ModuleConfigClient output to be assigned in the environment
2252
+ * @param name The name of the binding
2253
+ * @param description A description of the desired value of the binding
2254
+ */
2255
+ withModuleConfigClientOutput = (name, description) => {
2256
+ const ctx = this._ctx.select("withModuleConfigClientOutput", {
2257
+ name,
2258
+ description,
2259
+ });
2260
+ return new Env(ctx);
2261
+ };
2262
+ /**
2263
+ * Create or update a binding of type Module in the environment
2264
+ * @param name The name of the binding
2265
+ * @param value The Module value to assign to the binding
2266
+ * @param description The purpose of the input
2267
+ */
2268
+ withModuleInput = (name, value, description) => {
2269
+ const ctx = this._ctx.select("withModuleInput", {
2270
+ name,
2271
+ value,
2272
+ description,
2273
+ });
2274
+ return new Env(ctx);
2275
+ };
2276
+ /**
2277
+ * Declare a desired Module output to be assigned in the environment
2278
+ * @param name The name of the binding
2279
+ * @param description A description of the desired value of the binding
2280
+ */
2281
+ withModuleOutput = (name, description) => {
2282
+ const ctx = this._ctx.select("withModuleOutput", { name, description });
2283
+ return new Env(ctx);
2284
+ };
2285
+ /**
2286
+ * Create or update a binding of type ModuleSource in the environment
2287
+ * @param name The name of the binding
2288
+ * @param value The ModuleSource value to assign to the binding
2289
+ * @param description The purpose of the input
2290
+ */
2291
+ withModuleSourceInput = (name, value, description) => {
2292
+ const ctx = this._ctx.select("withModuleSourceInput", {
2293
+ name,
2294
+ value,
2295
+ description,
2296
+ });
2297
+ return new Env(ctx);
2298
+ };
2299
+ /**
2300
+ * Declare a desired ModuleSource output to be assigned in the environment
2301
+ * @param name The name of the binding
2302
+ * @param description A description of the desired value of the binding
2303
+ */
2304
+ withModuleSourceOutput = (name, description) => {
2305
+ const ctx = this._ctx.select("withModuleSourceOutput", {
2306
+ name,
2307
+ description,
2308
+ });
2309
+ return new Env(ctx);
2310
+ };
2311
+ /**
2312
+ * Create or update a binding of type Secret in the environment
2313
+ * @param name The name of the binding
2314
+ * @param value The Secret value to assign to the binding
2315
+ * @param description The purpose of the input
2316
+ */
2317
+ withSecretInput = (name, value, description) => {
2318
+ const ctx = this._ctx.select("withSecretInput", {
2319
+ name,
2320
+ value,
2321
+ description,
2322
+ });
2323
+ return new Env(ctx);
2324
+ };
2325
+ /**
2326
+ * Declare a desired Secret output to be assigned in the environment
2327
+ * @param name The name of the binding
2328
+ * @param description A description of the desired value of the binding
2329
+ */
2330
+ withSecretOutput = (name, description) => {
2331
+ const ctx = this._ctx.select("withSecretOutput", { name, description });
2332
+ return new Env(ctx);
2333
+ };
2334
+ /**
2335
+ * Create or update a binding of type Service in the environment
2336
+ * @param name The name of the binding
2337
+ * @param value The Service value to assign to the binding
2338
+ * @param description The purpose of the input
2339
+ */
2340
+ withServiceInput = (name, value, description) => {
2341
+ const ctx = this._ctx.select("withServiceInput", {
2342
+ name,
2343
+ value,
2344
+ description,
2345
+ });
2346
+ return new Env(ctx);
2347
+ };
2348
+ /**
2349
+ * Declare a desired Service output to be assigned in the environment
2350
+ * @param name The name of the binding
2351
+ * @param description A description of the desired value of the binding
2352
+ */
2353
+ withServiceOutput = (name, description) => {
2354
+ const ctx = this._ctx.select("withServiceOutput", { name, description });
2355
+ return new Env(ctx);
2356
+ };
2357
+ /**
2358
+ * Create or update a binding of type Socket in the environment
2359
+ * @param name The name of the binding
2360
+ * @param value The Socket value to assign to the binding
2361
+ * @param description The purpose of the input
2362
+ */
2363
+ withSocketInput = (name, value, description) => {
2364
+ const ctx = this._ctx.select("withSocketInput", {
2365
+ name,
2366
+ value,
2367
+ description,
2368
+ });
2369
+ return new Env(ctx);
2370
+ };
2371
+ /**
2372
+ * Declare a desired Socket output to be assigned in the environment
2373
+ * @param name The name of the binding
2374
+ * @param description A description of the desired value of the binding
2375
+ */
2376
+ withSocketOutput = (name, description) => {
2377
+ const ctx = this._ctx.select("withSocketOutput", { name, description });
2378
+ return new Env(ctx);
2379
+ };
2380
+ /**
2381
+ * Create or update an input value of type string
2382
+ * @param name The name of the binding
2383
+ * @param value The string value to assign to the binding
2384
+ */
2385
+ withStringInput = (name, value, description) => {
2386
+ const ctx = this._ctx.select("withStringInput", {
2387
+ name,
2388
+ value,
2389
+ description,
2390
+ });
2391
+ return new Env(ctx);
2392
+ };
2393
+ /**
2394
+ * Call the provided function with current Env.
2395
+ *
2396
+ * This is useful for reusability and readability by not breaking the calling chain.
2397
+ */
2398
+ with = (arg) => {
2399
+ return arg(this);
2400
+ };
2401
+ }
1853
2402
  /**
1854
2403
  * An environment variable name and value.
1855
2404
  */
@@ -2988,8 +3537,6 @@ export class InterfaceTypeDef extends BaseClient {
2988
3537
  }
2989
3538
  export class LLM extends BaseClient {
2990
3539
  _id = undefined;
2991
- _currentType = undefined;
2992
- _getString = undefined;
2993
3540
  _historyJSON = undefined;
2994
3541
  _lastReply = undefined;
2995
3542
  _model = undefined;
@@ -2999,11 +3546,9 @@ export class LLM extends BaseClient {
2999
3546
  /**
3000
3547
  * Constructor is used for internal usage only, do not create object from it.
3001
3548
  */
3002
- constructor(ctx, _id, _currentType, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
3549
+ constructor(ctx, _id, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
3003
3550
  super(ctx);
3004
3551
  this._id = _id;
3005
- this._currentType = _currentType;
3006
- this._getString = _getString;
3007
3552
  this._historyJSON = _historyJSON;
3008
3553
  this._lastReply = _lastReply;
3009
3554
  this._model = _model;
@@ -3032,873 +3577,77 @@ export class LLM extends BaseClient {
3032
3577
  return new LLM(ctx);
3033
3578
  };
3034
3579
  /**
3035
- * Retrieve a the current value in the LLM environment, of type CacheVolume
3580
+ * returns the type of the current state
3036
3581
  */
3037
- cacheVolume = () => {
3038
- const ctx = this._ctx.select("cacheVolume");
3039
- return new CacheVolume(ctx);
3582
+ bindResult = (name) => {
3583
+ const ctx = this._ctx.select("bindResult", { name });
3584
+ return new Binding(ctx);
3040
3585
  };
3041
3586
  /**
3042
- * Retrieve a the current value in the LLM environment, of type Container
3587
+ * return the LLM's current environment
3043
3588
  */
3044
- container = () => {
3045
- const ctx = this._ctx.select("container");
3046
- return new Container(ctx);
3589
+ env = () => {
3590
+ const ctx = this._ctx.select("env");
3591
+ return new Env(ctx);
3047
3592
  };
3048
3593
  /**
3049
- * Retrieve a the current value in the LLM environment, of type CurrentModule
3050
- */
3051
- currentModule = () => {
3052
- const ctx = this._ctx.select("currentModule");
3053
- return new CurrentModule(ctx);
3054
- };
3055
- /**
3056
- * returns the type of the current state
3057
- */
3058
- currentType = async () => {
3059
- if (this._currentType) {
3060
- return this._currentType;
3061
- }
3062
- const ctx = this._ctx.select("currentType");
3063
- const response = await ctx.execute();
3064
- return response;
3065
- };
3066
- /**
3067
- * Retrieve a the current value in the LLM environment, of type Directory
3068
- */
3069
- directory = () => {
3070
- const ctx = this._ctx.select("directory");
3071
- return new Directory(ctx);
3072
- };
3073
- /**
3074
- * Retrieve a the current value in the LLM environment, of type EnumTypeDef
3075
- */
3076
- enumTypeDef = () => {
3077
- const ctx = this._ctx.select("enumTypeDef");
3078
- return new EnumTypeDef(ctx);
3079
- };
3080
- /**
3081
- * Retrieve a the current value in the LLM environment, of type EnumValueTypeDef
3082
- */
3083
- enumValueTypeDef = () => {
3084
- const ctx = this._ctx.select("enumValueTypeDef");
3085
- return new EnumValueTypeDef(ctx);
3086
- };
3087
- /**
3088
- * Retrieve a the current value in the LLM environment, of type Error
3089
- */
3090
- error = () => {
3091
- const ctx = this._ctx.select("error");
3092
- return new Error(ctx);
3093
- };
3094
- /**
3095
- * Retrieve a the current value in the LLM environment, of type ErrorValue
3096
- */
3097
- errorValue = () => {
3098
- const ctx = this._ctx.select("errorValue");
3099
- return new ErrorValue(ctx);
3100
- };
3101
- /**
3102
- * Retrieve a the current value in the LLM environment, of type FieldTypeDef
3103
- */
3104
- fieldTypeDef = () => {
3105
- const ctx = this._ctx.select("fieldTypeDef");
3106
- return new FieldTypeDef(ctx);
3107
- };
3108
- /**
3109
- * Retrieve a the current value in the LLM environment, of type File
3110
- */
3111
- file = () => {
3112
- const ctx = this._ctx.select("file");
3113
- return new File(ctx);
3114
- };
3115
- /**
3116
- * Retrieve a the current value in the LLM environment, of type Function
3117
- */
3118
- function_ = () => {
3119
- const ctx = this._ctx.select("function");
3120
- return new Function_(ctx);
3121
- };
3122
- /**
3123
- * Retrieve a the current value in the LLM environment, of type FunctionArg
3124
- */
3125
- functionArg = () => {
3126
- const ctx = this._ctx.select("functionArg");
3127
- return new FunctionArg(ctx);
3128
- };
3129
- /**
3130
- * Retrieve a the current value in the LLM environment, of type FunctionCall
3131
- */
3132
- functionCall = () => {
3133
- const ctx = this._ctx.select("functionCall");
3134
- return new FunctionCall(ctx);
3135
- };
3136
- /**
3137
- * Retrieve a the current value in the LLM environment, of type FunctionCallArgValue
3138
- */
3139
- functionCallArgValue = () => {
3140
- const ctx = this._ctx.select("functionCallArgValue");
3141
- return new FunctionCallArgValue(ctx);
3142
- };
3143
- /**
3144
- * Retrieve a the current value in the LLM environment, of type GeneratedCode
3145
- */
3146
- generatedCode = () => {
3147
- const ctx = this._ctx.select("generatedCode");
3148
- return new GeneratedCode(ctx);
3149
- };
3150
- /**
3151
- * Retrieve a variable in the llm environment, of type CacheVolume
3152
- * @param name The name of the variable
3153
- */
3154
- getCacheVolume = (name) => {
3155
- const ctx = this._ctx.select("getCacheVolume", { name });
3156
- return new CacheVolume(ctx);
3157
- };
3158
- /**
3159
- * Retrieve a variable in the llm environment, of type Container
3160
- * @param name The name of the variable
3161
- */
3162
- getContainer = (name) => {
3163
- const ctx = this._ctx.select("getContainer", { name });
3164
- return new Container(ctx);
3165
- };
3166
- /**
3167
- * Retrieve a variable in the llm environment, of type CurrentModule
3168
- * @param name The name of the variable
3169
- */
3170
- getCurrentModule = (name) => {
3171
- const ctx = this._ctx.select("getCurrentModule", { name });
3172
- return new CurrentModule(ctx);
3173
- };
3174
- /**
3175
- * Retrieve a variable in the llm environment, of type Directory
3176
- * @param name The name of the variable
3177
- */
3178
- getDirectory = (name) => {
3179
- const ctx = this._ctx.select("getDirectory", { name });
3180
- return new Directory(ctx);
3181
- };
3182
- /**
3183
- * Retrieve a variable in the llm environment, of type EnumTypeDef
3184
- * @param name The name of the variable
3185
- */
3186
- getEnumTypeDef = (name) => {
3187
- const ctx = this._ctx.select("getEnumTypeDef", { name });
3188
- return new EnumTypeDef(ctx);
3189
- };
3190
- /**
3191
- * Retrieve a variable in the llm environment, of type EnumValueTypeDef
3192
- * @param name The name of the variable
3193
- */
3194
- getEnumValueTypeDef = (name) => {
3195
- const ctx = this._ctx.select("getEnumValueTypeDef", { name });
3196
- return new EnumValueTypeDef(ctx);
3197
- };
3198
- /**
3199
- * Retrieve a variable in the llm environment, of type Error
3200
- * @param name The name of the variable
3201
- */
3202
- getError = (name) => {
3203
- const ctx = this._ctx.select("getError", { name });
3204
- return new Error(ctx);
3205
- };
3206
- /**
3207
- * Retrieve a variable in the llm environment, of type ErrorValue
3208
- * @param name The name of the variable
3209
- */
3210
- getErrorValue = (name) => {
3211
- const ctx = this._ctx.select("getErrorValue", { name });
3212
- return new ErrorValue(ctx);
3213
- };
3214
- /**
3215
- * Retrieve a variable in the llm environment, of type FieldTypeDef
3216
- * @param name The name of the variable
3217
- */
3218
- getFieldTypeDef = (name) => {
3219
- const ctx = this._ctx.select("getFieldTypeDef", { name });
3220
- return new FieldTypeDef(ctx);
3221
- };
3222
- /**
3223
- * Retrieve a variable in the llm environment, of type File
3224
- * @param name The name of the variable
3225
- */
3226
- getFile = (name) => {
3227
- const ctx = this._ctx.select("getFile", { name });
3228
- return new File(ctx);
3229
- };
3230
- /**
3231
- * Retrieve a variable in the llm environment, of type Function
3232
- * @param name The name of the variable
3233
- */
3234
- getFunction = (name) => {
3235
- const ctx = this._ctx.select("getFunction", { name });
3236
- return new Function_(ctx);
3237
- };
3238
- /**
3239
- * Retrieve a variable in the llm environment, of type FunctionArg
3240
- * @param name The name of the variable
3241
- */
3242
- getFunctionArg = (name) => {
3243
- const ctx = this._ctx.select("getFunctionArg", { name });
3244
- return new FunctionArg(ctx);
3245
- };
3246
- /**
3247
- * Retrieve a variable in the llm environment, of type FunctionCall
3248
- * @param name The name of the variable
3249
- */
3250
- getFunctionCall = (name) => {
3251
- const ctx = this._ctx.select("getFunctionCall", { name });
3252
- return new FunctionCall(ctx);
3253
- };
3254
- /**
3255
- * Retrieve a variable in the llm environment, of type FunctionCallArgValue
3256
- * @param name The name of the variable
3257
- */
3258
- getFunctionCallArgValue = (name) => {
3259
- const ctx = this._ctx.select("getFunctionCallArgValue", { name });
3260
- return new FunctionCallArgValue(ctx);
3261
- };
3262
- /**
3263
- * Retrieve a variable in the llm environment, of type GeneratedCode
3264
- * @param name The name of the variable
3265
- */
3266
- getGeneratedCode = (name) => {
3267
- const ctx = this._ctx.select("getGeneratedCode", { name });
3268
- return new GeneratedCode(ctx);
3269
- };
3270
- /**
3271
- * Retrieve a variable in the llm environment, of type GitRef
3272
- * @param name The name of the variable
3273
- */
3274
- getGitRef = (name) => {
3275
- const ctx = this._ctx.select("getGitRef", { name });
3276
- return new GitRef(ctx);
3277
- };
3278
- /**
3279
- * Retrieve a variable in the llm environment, of type GitRepository
3280
- * @param name The name of the variable
3281
- */
3282
- getGitRepository = (name) => {
3283
- const ctx = this._ctx.select("getGitRepository", { name });
3284
- return new GitRepository(ctx);
3285
- };
3286
- /**
3287
- * Retrieve a variable in the llm environment, of type InputTypeDef
3288
- * @param name The name of the variable
3289
- */
3290
- getInputTypeDef = (name) => {
3291
- const ctx = this._ctx.select("getInputTypeDef", { name });
3292
- return new InputTypeDef(ctx);
3293
- };
3294
- /**
3295
- * Retrieve a variable in the llm environment, of type InterfaceTypeDef
3296
- * @param name The name of the variable
3297
- */
3298
- getInterfaceTypeDef = (name) => {
3299
- const ctx = this._ctx.select("getInterfaceTypeDef", { name });
3300
- return new InterfaceTypeDef(ctx);
3301
- };
3302
- /**
3303
- * Retrieve a variable in the llm environment, of type LLM
3304
- * @param name The name of the variable
3305
- */
3306
- getLLM = (name) => {
3307
- const ctx = this._ctx.select("getLLM", { name });
3308
- return new LLM(ctx);
3309
- };
3310
- /**
3311
- * Retrieve a variable in the llm environment, of type ListTypeDef
3312
- * @param name The name of the variable
3313
- */
3314
- getListTypeDef = (name) => {
3315
- const ctx = this._ctx.select("getListTypeDef", { name });
3316
- return new ListTypeDef(ctx);
3317
- };
3318
- /**
3319
- * Retrieve a variable in the llm environment, of type Module
3320
- * @param name The name of the variable
3321
- */
3322
- getModule = (name) => {
3323
- const ctx = this._ctx.select("getModule", { name });
3324
- return new Module_(ctx);
3325
- };
3326
- /**
3327
- * Retrieve a variable in the llm environment, of type ModuleConfigClient
3328
- * @param name The name of the variable
3329
- */
3330
- getModuleConfigClient = (name) => {
3331
- const ctx = this._ctx.select("getModuleConfigClient", { name });
3332
- return new ModuleConfigClient(ctx);
3333
- };
3334
- /**
3335
- * Retrieve a variable in the llm environment, of type ModuleSource
3336
- * @param name The name of the variable
3337
- */
3338
- getModuleSource = (name) => {
3339
- const ctx = this._ctx.select("getModuleSource", { name });
3340
- return new ModuleSource(ctx);
3341
- };
3342
- /**
3343
- * Retrieve a variable in the llm environment, of type ObjectTypeDef
3344
- * @param name The name of the variable
3345
- */
3346
- getObjectTypeDef = (name) => {
3347
- const ctx = this._ctx.select("getObjectTypeDef", { name });
3348
- return new ObjectTypeDef(ctx);
3349
- };
3350
- /**
3351
- * Retrieve a variable in the llm environment, of type SDKConfig
3352
- * @param name The name of the variable
3353
- */
3354
- getSDKConfig = (name) => {
3355
- const ctx = this._ctx.select("getSDKConfig", { name });
3356
- return new SDKConfig(ctx);
3357
- };
3358
- /**
3359
- * Retrieve a variable in the llm environment, of type ScalarTypeDef
3360
- * @param name The name of the variable
3361
- */
3362
- getScalarTypeDef = (name) => {
3363
- const ctx = this._ctx.select("getScalarTypeDef", { name });
3364
- return new ScalarTypeDef(ctx);
3365
- };
3366
- /**
3367
- * Retrieve a variable in the llm environment, of type Secret
3368
- * @param name The name of the variable
3369
- */
3370
- getSecret = (name) => {
3371
- const ctx = this._ctx.select("getSecret", { name });
3372
- return new Secret(ctx);
3373
- };
3374
- /**
3375
- * Retrieve a variable in the llm environment, of type Service
3376
- * @param name The name of the variable
3377
- */
3378
- getService = (name) => {
3379
- const ctx = this._ctx.select("getService", { name });
3380
- return new Service(ctx);
3381
- };
3382
- /**
3383
- * Retrieve a variable in the llm environment, of type Socket
3384
- * @param name The name of the variable
3385
- */
3386
- getSocket = (name) => {
3387
- const ctx = this._ctx.select("getSocket", { name });
3388
- return new Socket(ctx);
3389
- };
3390
- /**
3391
- * Retrieve a variable in the llm environment, of type SourceMap
3392
- * @param name The name of the variable
3393
- */
3394
- getSourceMap = (name) => {
3395
- const ctx = this._ctx.select("getSourceMap", { name });
3396
- return new SourceMap(ctx);
3397
- };
3398
- /**
3399
- * Get a string variable from the LLM's environment
3400
- * @param name The variable name
3401
- */
3402
- getString = async (name) => {
3403
- if (this._getString) {
3404
- return this._getString;
3405
- }
3406
- const ctx = this._ctx.select("getString", { name });
3407
- const response = await ctx.execute();
3408
- return response;
3409
- };
3410
- /**
3411
- * Retrieve a variable in the llm environment, of type Terminal
3412
- * @param name The name of the variable
3413
- */
3414
- getTerminal = (name) => {
3415
- const ctx = this._ctx.select("getTerminal", { name });
3416
- return new Terminal(ctx);
3417
- };
3418
- /**
3419
- * Retrieve a variable in the llm environment, of type TypeDef
3420
- * @param name The name of the variable
3421
- */
3422
- getTypeDef = (name) => {
3423
- const ctx = this._ctx.select("getTypeDef", { name });
3424
- return new TypeDef(ctx);
3425
- };
3426
- /**
3427
- * Retrieve a the current value in the LLM environment, of type GitRef
3428
- */
3429
- gitRef = () => {
3430
- const ctx = this._ctx.select("gitRef");
3431
- return new GitRef(ctx);
3432
- };
3433
- /**
3434
- * Retrieve a the current value in the LLM environment, of type GitRepository
3435
- */
3436
- gitRepository = () => {
3437
- const ctx = this._ctx.select("gitRepository");
3438
- return new GitRepository(ctx);
3439
- };
3440
- /**
3441
- * return the llm message history
3442
- */
3443
- history = async () => {
3444
- const ctx = this._ctx.select("history");
3445
- const response = await ctx.execute();
3446
- return response;
3447
- };
3448
- /**
3449
- * return the raw llm message history as json
3450
- */
3451
- historyJSON = async () => {
3452
- if (this._historyJSON) {
3453
- return this._historyJSON;
3454
- }
3455
- const ctx = this._ctx.select("historyJSON");
3456
- const response = await ctx.execute();
3457
- return response;
3458
- };
3459
- /**
3460
- * Retrieve a the current value in the LLM environment, of type InputTypeDef
3461
- */
3462
- inputTypeDef = () => {
3463
- const ctx = this._ctx.select("inputTypeDef");
3464
- return new InputTypeDef(ctx);
3465
- };
3466
- /**
3467
- * Retrieve a the current value in the LLM environment, of type InterfaceTypeDef
3468
- */
3469
- interfaceTypeDef = () => {
3470
- const ctx = this._ctx.select("interfaceTypeDef");
3471
- return new InterfaceTypeDef(ctx);
3472
- };
3473
- /**
3474
- * Retrieve a the current value in the LLM environment, of type LLM
3475
- */
3476
- lLM = () => {
3477
- const ctx = this._ctx.select("lLM");
3478
- return new LLM(ctx);
3479
- };
3480
- /**
3481
- * return the last llm reply from the history
3482
- */
3483
- lastReply = async () => {
3484
- if (this._lastReply) {
3485
- return this._lastReply;
3486
- }
3487
- const ctx = this._ctx.select("lastReply");
3488
- const response = await ctx.execute();
3489
- return response;
3490
- };
3491
- /**
3492
- * Retrieve a the current value in the LLM environment, of type ListTypeDef
3493
- */
3494
- listTypeDef = () => {
3495
- const ctx = this._ctx.select("listTypeDef");
3496
- return new ListTypeDef(ctx);
3497
- };
3498
- /**
3499
- * synchronize LLM state
3500
- */
3501
- loop = () => {
3502
- const ctx = this._ctx.select("loop");
3503
- return new LLM(ctx);
3504
- };
3505
- /**
3506
- * return the model used by the llm
3507
- */
3508
- model = async () => {
3509
- if (this._model) {
3510
- return this._model;
3511
- }
3512
- const ctx = this._ctx.select("model");
3513
- const response = await ctx.execute();
3514
- return response;
3515
- };
3516
- /**
3517
- * Retrieve a the current value in the LLM environment, of type Module
3518
- */
3519
- module_ = () => {
3520
- const ctx = this._ctx.select("module");
3521
- return new Module_(ctx);
3522
- };
3523
- /**
3524
- * Retrieve a the current value in the LLM environment, of type ModuleConfigClient
3525
- */
3526
- moduleConfigClient = () => {
3527
- const ctx = this._ctx.select("moduleConfigClient");
3528
- return new ModuleConfigClient(ctx);
3529
- };
3530
- /**
3531
- * Retrieve a the current value in the LLM environment, of type ModuleSource
3532
- */
3533
- moduleSource = () => {
3534
- const ctx = this._ctx.select("moduleSource");
3535
- return new ModuleSource(ctx);
3536
- };
3537
- /**
3538
- * Retrieve a the current value in the LLM environment, of type ObjectTypeDef
3539
- */
3540
- objectTypeDef = () => {
3541
- const ctx = this._ctx.select("objectTypeDef");
3542
- return new ObjectTypeDef(ctx);
3543
- };
3544
- /**
3545
- * return the provider used by the llm
3546
- */
3547
- provider = async () => {
3548
- if (this._provider) {
3549
- return this._provider;
3550
- }
3551
- const ctx = this._ctx.select("provider");
3552
- const response = await ctx.execute();
3553
- return response;
3554
- };
3555
- /**
3556
- * Retrieve a the current value in the LLM environment, of type ScalarTypeDef
3557
- */
3558
- scalarTypeDef = () => {
3559
- const ctx = this._ctx.select("scalarTypeDef");
3560
- return new ScalarTypeDef(ctx);
3561
- };
3562
- /**
3563
- * Retrieve a the current value in the LLM environment, of type SDKConfig
3564
- */
3565
- sdkconfig = () => {
3566
- const ctx = this._ctx.select("sdkconfig");
3567
- return new SDKConfig(ctx);
3568
- };
3569
- /**
3570
- * Retrieve a the current value in the LLM environment, of type Secret
3571
- */
3572
- secret = () => {
3573
- const ctx = this._ctx.select("secret");
3574
- return new Secret(ctx);
3575
- };
3576
- /**
3577
- * Retrieve a the current value in the LLM environment, of type Service
3578
- */
3579
- service = () => {
3580
- const ctx = this._ctx.select("service");
3581
- return new Service(ctx);
3582
- };
3583
- /**
3584
- * Set a variable of type CacheVolume in the llm environment
3585
- * @param name The name of the variable
3586
- * @param value The CacheVolume value to assign to the variable
3587
- */
3588
- setCacheVolume = (name, value) => {
3589
- const ctx = this._ctx.select("setCacheVolume", { name, value });
3590
- return new LLM(ctx);
3591
- };
3592
- /**
3593
- * Set a variable of type Container in the llm environment
3594
- * @param name The name of the variable
3595
- * @param value The Container value to assign to the variable
3596
- */
3597
- setContainer = (name, value) => {
3598
- const ctx = this._ctx.select("setContainer", { name, value });
3599
- return new LLM(ctx);
3600
- };
3601
- /**
3602
- * Set a variable of type CurrentModule in the llm environment
3603
- * @param name The name of the variable
3604
- * @param value The CurrentModule value to assign to the variable
3605
- */
3606
- setCurrentModule = (name, value) => {
3607
- const ctx = this._ctx.select("setCurrentModule", { name, value });
3608
- return new LLM(ctx);
3609
- };
3610
- /**
3611
- * Set a variable of type Directory in the llm environment
3612
- * @param name The name of the variable
3613
- * @param value The Directory value to assign to the variable
3614
- */
3615
- setDirectory = (name, value) => {
3616
- const ctx = this._ctx.select("setDirectory", { name, value });
3617
- return new LLM(ctx);
3618
- };
3619
- /**
3620
- * Set a variable of type EnumTypeDef in the llm environment
3621
- * @param name The name of the variable
3622
- * @param value The EnumTypeDef value to assign to the variable
3623
- */
3624
- setEnumTypeDef = (name, value) => {
3625
- const ctx = this._ctx.select("setEnumTypeDef", { name, value });
3626
- return new LLM(ctx);
3627
- };
3628
- /**
3629
- * Set a variable of type EnumValueTypeDef in the llm environment
3630
- * @param name The name of the variable
3631
- * @param value The EnumValueTypeDef value to assign to the variable
3632
- */
3633
- setEnumValueTypeDef = (name, value) => {
3634
- const ctx = this._ctx.select("setEnumValueTypeDef", { name, value });
3635
- return new LLM(ctx);
3636
- };
3637
- /**
3638
- * Set a variable of type Error in the llm environment
3639
- * @param name The name of the variable
3640
- * @param value The Error value to assign to the variable
3641
- */
3642
- setError = (name, value) => {
3643
- const ctx = this._ctx.select("setError", { name, value });
3644
- return new LLM(ctx);
3645
- };
3646
- /**
3647
- * Set a variable of type ErrorValue in the llm environment
3648
- * @param name The name of the variable
3649
- * @param value The ErrorValue value to assign to the variable
3650
- */
3651
- setErrorValue = (name, value) => {
3652
- const ctx = this._ctx.select("setErrorValue", { name, value });
3653
- return new LLM(ctx);
3654
- };
3655
- /**
3656
- * Set a variable of type FieldTypeDef in the llm environment
3657
- * @param name The name of the variable
3658
- * @param value The FieldTypeDef value to assign to the variable
3659
- */
3660
- setFieldTypeDef = (name, value) => {
3661
- const ctx = this._ctx.select("setFieldTypeDef", { name, value });
3662
- return new LLM(ctx);
3663
- };
3664
- /**
3665
- * Set a variable of type File in the llm environment
3666
- * @param name The name of the variable
3667
- * @param value The File value to assign to the variable
3668
- */
3669
- setFile = (name, value) => {
3670
- const ctx = this._ctx.select("setFile", { name, value });
3671
- return new LLM(ctx);
3672
- };
3673
- /**
3674
- * Set a variable of type Function in the llm environment
3675
- * @param name The name of the variable
3676
- * @param value The Function value to assign to the variable
3677
- */
3678
- setFunction = (name, value) => {
3679
- const ctx = this._ctx.select("setFunction", { name, value });
3680
- return new LLM(ctx);
3681
- };
3682
- /**
3683
- * Set a variable of type FunctionArg in the llm environment
3684
- * @param name The name of the variable
3685
- * @param value The FunctionArg value to assign to the variable
3686
- */
3687
- setFunctionArg = (name, value) => {
3688
- const ctx = this._ctx.select("setFunctionArg", { name, value });
3689
- return new LLM(ctx);
3690
- };
3691
- /**
3692
- * Set a variable of type FunctionCall in the llm environment
3693
- * @param name The name of the variable
3694
- * @param value The FunctionCall value to assign to the variable
3695
- */
3696
- setFunctionCall = (name, value) => {
3697
- const ctx = this._ctx.select("setFunctionCall", { name, value });
3698
- return new LLM(ctx);
3699
- };
3700
- /**
3701
- * Set a variable of type FunctionCallArgValue in the llm environment
3702
- * @param name The name of the variable
3703
- * @param value The FunctionCallArgValue value to assign to the variable
3704
- */
3705
- setFunctionCallArgValue = (name, value) => {
3706
- const ctx = this._ctx.select("setFunctionCallArgValue", { name, value });
3707
- return new LLM(ctx);
3708
- };
3709
- /**
3710
- * Set a variable of type GeneratedCode in the llm environment
3711
- * @param name The name of the variable
3712
- * @param value The GeneratedCode value to assign to the variable
3713
- */
3714
- setGeneratedCode = (name, value) => {
3715
- const ctx = this._ctx.select("setGeneratedCode", { name, value });
3716
- return new LLM(ctx);
3717
- };
3718
- /**
3719
- * Set a variable of type GitRef in the llm environment
3720
- * @param name The name of the variable
3721
- * @param value The GitRef value to assign to the variable
3722
- */
3723
- setGitRef = (name, value) => {
3724
- const ctx = this._ctx.select("setGitRef", { name, value });
3725
- return new LLM(ctx);
3726
- };
3727
- /**
3728
- * Set a variable of type GitRepository in the llm environment
3729
- * @param name The name of the variable
3730
- * @param value The GitRepository value to assign to the variable
3731
- */
3732
- setGitRepository = (name, value) => {
3733
- const ctx = this._ctx.select("setGitRepository", { name, value });
3734
- return new LLM(ctx);
3735
- };
3736
- /**
3737
- * Set a variable of type InputTypeDef in the llm environment
3738
- * @param name The name of the variable
3739
- * @param value The InputTypeDef value to assign to the variable
3740
- */
3741
- setInputTypeDef = (name, value) => {
3742
- const ctx = this._ctx.select("setInputTypeDef", { name, value });
3743
- return new LLM(ctx);
3744
- };
3745
- /**
3746
- * Set a variable of type InterfaceTypeDef in the llm environment
3747
- * @param name The name of the variable
3748
- * @param value The InterfaceTypeDef value to assign to the variable
3749
- */
3750
- setInterfaceTypeDef = (name, value) => {
3751
- const ctx = this._ctx.select("setInterfaceTypeDef", { name, value });
3752
- return new LLM(ctx);
3753
- };
3754
- /**
3755
- * Set a variable of type LLM in the llm environment
3756
- * @param name The name of the variable
3757
- * @param value The LLM value to assign to the variable
3758
- */
3759
- setLLM = (name, value) => {
3760
- const ctx = this._ctx.select("setLLM", { name, value });
3761
- return new LLM(ctx);
3762
- };
3763
- /**
3764
- * Set a variable of type ListTypeDef in the llm environment
3765
- * @param name The name of the variable
3766
- * @param value The ListTypeDef value to assign to the variable
3767
- */
3768
- setListTypeDef = (name, value) => {
3769
- const ctx = this._ctx.select("setListTypeDef", { name, value });
3770
- return new LLM(ctx);
3771
- };
3772
- /**
3773
- * Set a variable of type Module in the llm environment
3774
- * @param name The name of the variable
3775
- * @param value The Module value to assign to the variable
3776
- */
3777
- setModule = (name, value) => {
3778
- const ctx = this._ctx.select("setModule", { name, value });
3779
- return new LLM(ctx);
3780
- };
3781
- /**
3782
- * Set a variable of type ModuleConfigClient in the llm environment
3783
- * @param name The name of the variable
3784
- * @param value The ModuleConfigClient value to assign to the variable
3785
- */
3786
- setModuleConfigClient = (name, value) => {
3787
- const ctx = this._ctx.select("setModuleConfigClient", { name, value });
3788
- return new LLM(ctx);
3789
- };
3790
- /**
3791
- * Set a variable of type ModuleSource in the llm environment
3792
- * @param name The name of the variable
3793
- * @param value The ModuleSource value to assign to the variable
3794
- */
3795
- setModuleSource = (name, value) => {
3796
- const ctx = this._ctx.select("setModuleSource", { name, value });
3797
- return new LLM(ctx);
3798
- };
3799
- /**
3800
- * Set a variable of type ObjectTypeDef in the llm environment
3801
- * @param name The name of the variable
3802
- * @param value The ObjectTypeDef value to assign to the variable
3803
- */
3804
- setObjectTypeDef = (name, value) => {
3805
- const ctx = this._ctx.select("setObjectTypeDef", { name, value });
3806
- return new LLM(ctx);
3807
- };
3808
- /**
3809
- * Set a variable of type SDKConfig in the llm environment
3810
- * @param name The name of the variable
3811
- * @param value The SDKConfig value to assign to the variable
3812
- */
3813
- setSDKConfig = (name, value) => {
3814
- const ctx = this._ctx.select("setSDKConfig", { name, value });
3815
- return new LLM(ctx);
3816
- };
3817
- /**
3818
- * Set a variable of type ScalarTypeDef in the llm environment
3819
- * @param name The name of the variable
3820
- * @param value The ScalarTypeDef value to assign to the variable
3821
- */
3822
- setScalarTypeDef = (name, value) => {
3823
- const ctx = this._ctx.select("setScalarTypeDef", { name, value });
3824
- return new LLM(ctx);
3825
- };
3826
- /**
3827
- * Set a variable of type Secret in the llm environment
3828
- * @param name The name of the variable
3829
- * @param value The Secret value to assign to the variable
3830
- */
3831
- setSecret = (name, value) => {
3832
- const ctx = this._ctx.select("setSecret", { name, value });
3833
- return new LLM(ctx);
3834
- };
3835
- /**
3836
- * Set a variable of type Service in the llm environment
3837
- * @param name The name of the variable
3838
- * @param value The Service value to assign to the variable
3839
- */
3840
- setService = (name, value) => {
3841
- const ctx = this._ctx.select("setService", { name, value });
3842
- return new LLM(ctx);
3843
- };
3844
- /**
3845
- * Set a variable of type Socket in the llm environment
3846
- * @param name The name of the variable
3847
- * @param value The Socket value to assign to the variable
3848
- */
3849
- setSocket = (name, value) => {
3850
- const ctx = this._ctx.select("setSocket", { name, value });
3851
- return new LLM(ctx);
3852
- };
3853
- /**
3854
- * Set a variable of type SourceMap in the llm environment
3855
- * @param name The name of the variable
3856
- * @param value The SourceMap value to assign to the variable
3594
+ * return the llm message history
3857
3595
  */
3858
- setSourceMap = (name, value) => {
3859
- const ctx = this._ctx.select("setSourceMap", { name, value });
3860
- return new LLM(ctx);
3596
+ history = async () => {
3597
+ const ctx = this._ctx.select("history");
3598
+ const response = await ctx.execute();
3599
+ return response;
3861
3600
  };
3862
3601
  /**
3863
- * Add a string variable to the LLM's environment
3864
- * @param name The variable name
3865
- * @param value The variable value
3602
+ * return the raw llm message history as json
3866
3603
  */
3867
- setString = (name, value) => {
3868
- const ctx = this._ctx.select("setString", { name, value });
3869
- return new LLM(ctx);
3604
+ historyJSON = async () => {
3605
+ if (this._historyJSON) {
3606
+ return this._historyJSON;
3607
+ }
3608
+ const ctx = this._ctx.select("historyJSON");
3609
+ const response = await ctx.execute();
3610
+ return response;
3870
3611
  };
3871
3612
  /**
3872
- * Set a variable of type Terminal in the llm environment
3873
- * @param name The name of the variable
3874
- * @param value The Terminal value to assign to the variable
3613
+ * return the last llm reply from the history
3875
3614
  */
3876
- setTerminal = (name, value) => {
3877
- const ctx = this._ctx.select("setTerminal", { name, value });
3878
- return new LLM(ctx);
3615
+ lastReply = async () => {
3616
+ if (this._lastReply) {
3617
+ return this._lastReply;
3618
+ }
3619
+ const ctx = this._ctx.select("lastReply");
3620
+ const response = await ctx.execute();
3621
+ return response;
3879
3622
  };
3880
3623
  /**
3881
- * Set a variable of type TypeDef in the llm environment
3882
- * @param name The name of the variable
3883
- * @param value The TypeDef value to assign to the variable
3624
+ * synchronize LLM state
3884
3625
  */
3885
- setTypeDef = (name, value) => {
3886
- const ctx = this._ctx.select("setTypeDef", { name, value });
3626
+ loop = () => {
3627
+ const ctx = this._ctx.select("loop");
3887
3628
  return new LLM(ctx);
3888
3629
  };
3889
3630
  /**
3890
- * Retrieve a the current value in the LLM environment, of type Socket
3631
+ * return the model used by the llm
3891
3632
  */
3892
- socket = () => {
3893
- const ctx = this._ctx.select("socket");
3894
- return new Socket(ctx);
3633
+ model = async () => {
3634
+ if (this._model) {
3635
+ return this._model;
3636
+ }
3637
+ const ctx = this._ctx.select("model");
3638
+ const response = await ctx.execute();
3639
+ return response;
3895
3640
  };
3896
3641
  /**
3897
- * Retrieve a the current value in the LLM environment, of type SourceMap
3642
+ * return the provider used by the llm
3898
3643
  */
3899
- sourceMap = () => {
3900
- const ctx = this._ctx.select("sourceMap");
3901
- return new SourceMap(ctx);
3644
+ provider = async () => {
3645
+ if (this._provider) {
3646
+ return this._provider;
3647
+ }
3648
+ const ctx = this._ctx.select("provider");
3649
+ const response = await ctx.execute();
3650
+ return response;
3902
3651
  };
3903
3652
  /**
3904
3653
  * synchronize LLM state
@@ -3908,13 +3657,6 @@ export class LLM extends BaseClient {
3908
3657
  const response = await ctx.execute();
3909
3658
  return new Client(ctx.copy()).loadLLMFromID(response);
3910
3659
  };
3911
- /**
3912
- * Retrieve a the current value in the LLM environment, of type Terminal
3913
- */
3914
- terminal = () => {
3915
- const ctx = this._ctx.select("terminal");
3916
- return new Terminal(ctx);
3917
- };
3918
3660
  /**
3919
3661
  * returns the token usage of the current state
3920
3662
  */
@@ -3934,186 +3676,10 @@ export class LLM extends BaseClient {
3934
3676
  return response;
3935
3677
  };
3936
3678
  /**
3937
- * Retrieve a the current value in the LLM environment, of type TypeDef
3938
- */
3939
- typeDef = () => {
3940
- const ctx = this._ctx.select("typeDef");
3941
- return new TypeDef(ctx);
3942
- };
3943
- /**
3944
- * list variables in the LLM environment
3945
- */
3946
- variables = async () => {
3947
- const ctx = this._ctx.select("variables").select("id");
3948
- const response = await ctx.execute();
3949
- return response.map((r) => new Client(ctx.copy()).loadLLMVariableFromID(r.id));
3950
- };
3951
- /**
3952
- * Set a variable of type CacheVolume in the llm environment
3953
- * @param value The CacheVolume value to assign to the variable
3954
- */
3955
- withCacheVolume = (value) => {
3956
- const ctx = this._ctx.select("withCacheVolume", { value });
3957
- return new LLM(ctx);
3958
- };
3959
- /**
3960
- * Set a variable of type Container in the llm environment
3961
- * @param value The Container value to assign to the variable
3962
- */
3963
- withContainer = (value) => {
3964
- const ctx = this._ctx.select("withContainer", { value });
3965
- return new LLM(ctx);
3966
- };
3967
- /**
3968
- * Set a variable of type CurrentModule in the llm environment
3969
- * @param value The CurrentModule value to assign to the variable
3970
- */
3971
- withCurrentModule = (value) => {
3972
- const ctx = this._ctx.select("withCurrentModule", { value });
3973
- return new LLM(ctx);
3974
- };
3975
- /**
3976
- * Set a variable of type Directory in the llm environment
3977
- * @param value The Directory value to assign to the variable
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
- */
3987
- withEnumTypeDef = (value) => {
3988
- const ctx = this._ctx.select("withEnumTypeDef", { value });
3989
- return new LLM(ctx);
3990
- };
3991
- /**
3992
- * Set a variable of type EnumValueTypeDef in the llm environment
3993
- * @param value The EnumValueTypeDef value to assign to the variable
3994
- */
3995
- withEnumValueTypeDef = (value) => {
3996
- const ctx = this._ctx.select("withEnumValueTypeDef", { value });
3997
- return new LLM(ctx);
3998
- };
3999
- /**
4000
- * Set a variable of type Error in the llm environment
4001
- * @param value The Error value to assign to the variable
4002
- */
4003
- withError = (value) => {
4004
- const ctx = this._ctx.select("withError", { value });
4005
- return new LLM(ctx);
4006
- };
4007
- /**
4008
- * Set a variable of type ErrorValue in the llm environment
4009
- * @param value The ErrorValue value to assign to the variable
4010
- */
4011
- withErrorValue = (value) => {
4012
- const ctx = this._ctx.select("withErrorValue", { value });
4013
- return new LLM(ctx);
4014
- };
4015
- /**
4016
- * Set a variable of type FieldTypeDef in the llm environment
4017
- * @param value The FieldTypeDef value to assign to the variable
4018
- */
4019
- withFieldTypeDef = (value) => {
4020
- const ctx = this._ctx.select("withFieldTypeDef", { value });
4021
- return new LLM(ctx);
4022
- };
4023
- /**
4024
- * Set a variable of type File in the llm environment
4025
- * @param value The File value to assign to the variable
4026
- */
4027
- withFile = (value) => {
4028
- const ctx = this._ctx.select("withFile", { value });
4029
- return new LLM(ctx);
4030
- };
4031
- /**
4032
- * Set a variable of type Function in the llm environment
4033
- * @param value The Function value to assign to the variable
4034
- */
4035
- withFunction = (value) => {
4036
- const ctx = this._ctx.select("withFunction", { value });
4037
- return new LLM(ctx);
4038
- };
4039
- /**
4040
- * Set a variable of type FunctionArg in the llm environment
4041
- * @param value The FunctionArg value to assign to the variable
4042
- */
4043
- withFunctionArg = (value) => {
4044
- const ctx = this._ctx.select("withFunctionArg", { value });
4045
- return new LLM(ctx);
4046
- };
4047
- /**
4048
- * Set a variable of type FunctionCall in the llm environment
4049
- * @param value The FunctionCall value to assign to the variable
4050
- */
4051
- withFunctionCall = (value) => {
4052
- const ctx = this._ctx.select("withFunctionCall", { value });
4053
- return new LLM(ctx);
4054
- };
4055
- /**
4056
- * Set a variable of type FunctionCallArgValue in the llm environment
4057
- * @param value The FunctionCallArgValue value to assign to the variable
4058
- */
4059
- withFunctionCallArgValue = (value) => {
4060
- const ctx = this._ctx.select("withFunctionCallArgValue", { value });
4061
- return new LLM(ctx);
4062
- };
4063
- /**
4064
- * Set a variable of type GeneratedCode in the llm environment
4065
- * @param value The GeneratedCode value to assign to the variable
4066
- */
4067
- withGeneratedCode = (value) => {
4068
- const ctx = this._ctx.select("withGeneratedCode", { value });
4069
- return new LLM(ctx);
4070
- };
4071
- /**
4072
- * Set a variable of type GitRef in the llm environment
4073
- * @param value The GitRef value to assign to the variable
4074
- */
4075
- withGitRef = (value) => {
4076
- const ctx = this._ctx.select("withGitRef", { value });
4077
- return new LLM(ctx);
4078
- };
4079
- /**
4080
- * Set a variable of type GitRepository in the llm environment
4081
- * @param value The GitRepository value to assign to the variable
4082
- */
4083
- withGitRepository = (value) => {
4084
- const ctx = this._ctx.select("withGitRepository", { value });
4085
- return new LLM(ctx);
4086
- };
4087
- /**
4088
- * Set a variable of type InputTypeDef in the llm environment
4089
- * @param value The InputTypeDef value to assign to the variable
4090
- */
4091
- withInputTypeDef = (value) => {
4092
- const ctx = this._ctx.select("withInputTypeDef", { value });
4093
- return new LLM(ctx);
4094
- };
4095
- /**
4096
- * Set a variable of type InterfaceTypeDef in the llm environment
4097
- * @param value The InterfaceTypeDef value to assign to the variable
4098
- */
4099
- withInterfaceTypeDef = (value) => {
4100
- const ctx = this._ctx.select("withInterfaceTypeDef", { value });
4101
- return new LLM(ctx);
4102
- };
4103
- /**
4104
- * Set a variable of type LLM in the llm environment
4105
- * @param value The LLM value to assign to the variable
4106
- */
4107
- withLLM = (value) => {
4108
- const ctx = this._ctx.select("withLLM", { value });
4109
- return new LLM(ctx);
4110
- };
4111
- /**
4112
- * Set a variable of type ListTypeDef in the llm environment
4113
- * @param value The ListTypeDef value to assign to the variable
3679
+ * allow the LLM to interact with an environment via MCP
4114
3680
  */
4115
- withListTypeDef = (value) => {
4116
- const ctx = this._ctx.select("withListTypeDef", { value });
3681
+ withEnv = (env) => {
3682
+ const ctx = this._ctx.select("withEnv", { env });
4117
3683
  return new LLM(ctx);
4118
3684
  };
4119
3685
  /**
@@ -4124,38 +3690,6 @@ export class LLM extends BaseClient {
4124
3690
  const ctx = this._ctx.select("withModel", { model });
4125
3691
  return new LLM(ctx);
4126
3692
  };
4127
- /**
4128
- * Set a variable of type Module in the llm environment
4129
- * @param value The Module value to assign to the variable
4130
- */
4131
- withModule = (value) => {
4132
- const ctx = this._ctx.select("withModule", { value });
4133
- return new LLM(ctx);
4134
- };
4135
- /**
4136
- * Set a variable of type ModuleConfigClient in the llm environment
4137
- * @param value The ModuleConfigClient value to assign to the variable
4138
- */
4139
- withModuleConfigClient = (value) => {
4140
- const ctx = this._ctx.select("withModuleConfigClient", { value });
4141
- return new LLM(ctx);
4142
- };
4143
- /**
4144
- * Set a variable of type ModuleSource in the llm environment
4145
- * @param value The ModuleSource value to assign to the variable
4146
- */
4147
- withModuleSource = (value) => {
4148
- const ctx = this._ctx.select("withModuleSource", { value });
4149
- return new LLM(ctx);
4150
- };
4151
- /**
4152
- * Set a variable of type ObjectTypeDef in the llm environment
4153
- * @param value The ObjectTypeDef value to assign to the variable
4154
- */
4155
- withObjectTypeDef = (value) => {
4156
- const ctx = this._ctx.select("withObjectTypeDef", { value });
4157
- return new LLM(ctx);
4158
- };
4159
3693
  /**
4160
3694
  * append a prompt to the llm context
4161
3695
  * @param prompt The prompt to send
@@ -4172,15 +3706,6 @@ export class LLM extends BaseClient {
4172
3706
  const ctx = this._ctx.select("withPromptFile", { file });
4173
3707
  return new LLM(ctx);
4174
3708
  };
4175
- /**
4176
- * Add a string variable to the LLM's environment
4177
- * @param name The variable name
4178
- * @param value The variable value
4179
- */
4180
- withPromptVar = (name, value) => {
4181
- const ctx = this._ctx.select("withPromptVar", { name, value });
4182
- return new LLM(ctx);
4183
- };
4184
3709
  /**
4185
3710
  * Provide the entire Query object to the LLM
4186
3711
  */
@@ -4188,54 +3713,6 @@ export class LLM extends BaseClient {
4188
3713
  const ctx = this._ctx.select("withQuery");
4189
3714
  return new LLM(ctx);
4190
3715
  };
4191
- /**
4192
- * Set a variable of type SDKConfig in the llm environment
4193
- * @param value The SDKConfig value to assign to the variable
4194
- */
4195
- withSDKConfig = (value) => {
4196
- const ctx = this._ctx.select("withSDKConfig", { value });
4197
- return new LLM(ctx);
4198
- };
4199
- /**
4200
- * Set a variable of type ScalarTypeDef in the llm environment
4201
- * @param value The ScalarTypeDef value to assign to the variable
4202
- */
4203
- withScalarTypeDef = (value) => {
4204
- const ctx = this._ctx.select("withScalarTypeDef", { value });
4205
- return new LLM(ctx);
4206
- };
4207
- /**
4208
- * Set a variable of type Secret in the llm environment
4209
- * @param value The Secret value to assign to the variable
4210
- */
4211
- withSecret = (value) => {
4212
- const ctx = this._ctx.select("withSecret", { value });
4213
- return new LLM(ctx);
4214
- };
4215
- /**
4216
- * Set a variable of type Service in the llm environment
4217
- * @param value The Service value to assign to the variable
4218
- */
4219
- withService = (value) => {
4220
- const ctx = this._ctx.select("withService", { value });
4221
- return new LLM(ctx);
4222
- };
4223
- /**
4224
- * Set a variable of type Socket in the llm environment
4225
- * @param value The Socket value to assign to the variable
4226
- */
4227
- withSocket = (value) => {
4228
- const ctx = this._ctx.select("withSocket", { value });
4229
- return new LLM(ctx);
4230
- };
4231
- /**
4232
- * Set a variable of type SourceMap in the llm environment
4233
- * @param value The SourceMap value to assign to the variable
4234
- */
4235
- withSourceMap = (value) => {
4236
- const ctx = this._ctx.select("withSourceMap", { value });
4237
- return new LLM(ctx);
4238
- };
4239
3716
  /**
4240
3717
  * Add a system prompt to the LLM's environment
4241
3718
  * @param prompt The system prompt to send
@@ -4244,22 +3721,6 @@ export class LLM extends BaseClient {
4244
3721
  const ctx = this._ctx.select("withSystemPrompt", { prompt });
4245
3722
  return new LLM(ctx);
4246
3723
  };
4247
- /**
4248
- * Set a variable of type Terminal in the llm environment
4249
- * @param value The Terminal value to assign to the variable
4250
- */
4251
- withTerminal = (value) => {
4252
- const ctx = this._ctx.select("withTerminal", { value });
4253
- return new LLM(ctx);
4254
- };
4255
- /**
4256
- * Set a variable of type TypeDef in the llm environment
4257
- * @param value The TypeDef value to assign to the variable
4258
- */
4259
- withTypeDef = (value) => {
4260
- const ctx = this._ctx.select("withTypeDef", { value });
4261
- return new LLM(ctx);
4262
- };
4263
3724
  /**
4264
3725
  * Call the provided function with current LLM.
4265
3726
  *
@@ -4320,57 +3781,6 @@ export class LLMTokenUsage extends BaseClient {
4320
3781
  return response;
4321
3782
  };
4322
3783
  }
4323
- export class LLMVariable extends BaseClient {
4324
- _id = undefined;
4325
- _hash = undefined;
4326
- _name = undefined;
4327
- _typeName = undefined;
4328
- /**
4329
- * Constructor is used for internal usage only, do not create object from it.
4330
- */
4331
- constructor(ctx, _id, _hash, _name, _typeName) {
4332
- super(ctx);
4333
- this._id = _id;
4334
- this._hash = _hash;
4335
- this._name = _name;
4336
- this._typeName = _typeName;
4337
- }
4338
- /**
4339
- * A unique identifier for this LLMVariable.
4340
- */
4341
- id = async () => {
4342
- if (this._id) {
4343
- return this._id;
4344
- }
4345
- const ctx = this._ctx.select("id");
4346
- const response = await ctx.execute();
4347
- return response;
4348
- };
4349
- hash = async () => {
4350
- if (this._hash) {
4351
- return this._hash;
4352
- }
4353
- const ctx = this._ctx.select("hash");
4354
- const response = await ctx.execute();
4355
- return response;
4356
- };
4357
- name = async () => {
4358
- if (this._name) {
4359
- return this._name;
4360
- }
4361
- const ctx = this._ctx.select("name");
4362
- const response = await ctx.execute();
4363
- return response;
4364
- };
4365
- typeName = async () => {
4366
- if (this._typeName) {
4367
- return this._typeName;
4368
- }
4369
- const ctx = this._ctx.select("typeName");
4370
- const response = await ctx.execute();
4371
- return response;
4372
- };
4373
- }
4374
3784
  /**
4375
3785
  * A simple key value object that represents a label.
4376
3786
  */
@@ -5347,6 +4757,13 @@ export class Client extends BaseClient {
5347
4757
  const ctx = this._ctx.select("engine");
5348
4758
  return new Engine(ctx);
5349
4759
  };
4760
+ /**
4761
+ * Initialize a new environment
4762
+ */
4763
+ env = () => {
4764
+ const ctx = this._ctx.select("env");
4765
+ return new Env(ctx);
4766
+ };
5350
4767
  /**
5351
4768
  * Create a new error.
5352
4769
  * @param message A brief description of the error.
@@ -5412,6 +4829,13 @@ export class Client extends BaseClient {
5412
4829
  const ctx = this._ctx.select("llm", { ...opts });
5413
4830
  return new LLM(ctx);
5414
4831
  };
4832
+ /**
4833
+ * Load a Binding from its ID.
4834
+ */
4835
+ loadBindingFromID = (id) => {
4836
+ const ctx = this._ctx.select("loadBindingFromID", { id });
4837
+ return new Binding(ctx);
4838
+ };
5415
4839
  /**
5416
4840
  * Load a CacheVolume from its ID.
5417
4841
  */
@@ -5482,6 +4906,13 @@ export class Client extends BaseClient {
5482
4906
  const ctx = this._ctx.select("loadEnumValueTypeDefFromID", { id });
5483
4907
  return new EnumValueTypeDef(ctx);
5484
4908
  };
4909
+ /**
4910
+ * Load a Env from its ID.
4911
+ */
4912
+ loadEnvFromID = (id) => {
4913
+ const ctx = this._ctx.select("loadEnvFromID", { id });
4914
+ return new Env(ctx);
4915
+ };
5485
4916
  /**
5486
4917
  * Load a EnvVariable from its ID.
5487
4918
  */
@@ -5601,13 +5032,6 @@ export class Client extends BaseClient {
5601
5032
  const ctx = this._ctx.select("loadLLMTokenUsageFromID", { id });
5602
5033
  return new LLMTokenUsage(ctx);
5603
5034
  };
5604
- /**
5605
- * Load a LLMVariable from its ID.
5606
- */
5607
- loadLLMVariableFromID = (id) => {
5608
- const ctx = this._ctx.select("loadLLMVariableFromID", { id });
5609
- return new LLMVariable(ctx);
5610
- };
5611
5035
  /**
5612
5036
  * Load a Label from its ID.
5613
5037
  */