@dagger.io/dagger 0.17.1 → 0.18.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.
|
@@ -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
|
*/
|
|
@@ -1301,6 +1459,15 @@ export class Directory extends BaseClient {
|
|
|
1301
1459
|
const ctx = this._ctx.select("file", { path });
|
|
1302
1460
|
return new File(ctx);
|
|
1303
1461
|
};
|
|
1462
|
+
/**
|
|
1463
|
+
* Retrieves this directory as per exclude/include filters.
|
|
1464
|
+
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
1465
|
+
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
1466
|
+
*/
|
|
1467
|
+
filter = (opts) => {
|
|
1468
|
+
const ctx = this._ctx.select("filter", { ...opts });
|
|
1469
|
+
return new Directory(ctx);
|
|
1470
|
+
};
|
|
1304
1471
|
/**
|
|
1305
1472
|
* Returns a list of files and directories that matche the given pattern.
|
|
1306
1473
|
* @param pattern Pattern to match (e.g., "*.md").
|
|
@@ -1841,24 +2008,17 @@ export class EnumValueTypeDef extends BaseClient {
|
|
|
1841
2008
|
return new SourceMap(ctx);
|
|
1842
2009
|
};
|
|
1843
2010
|
}
|
|
1844
|
-
|
|
1845
|
-
* An environment variable name and value.
|
|
1846
|
-
*/
|
|
1847
|
-
export class EnvVariable extends BaseClient {
|
|
2011
|
+
export class Env extends BaseClient {
|
|
1848
2012
|
_id = undefined;
|
|
1849
|
-
_name = undefined;
|
|
1850
|
-
_value = undefined;
|
|
1851
2013
|
/**
|
|
1852
2014
|
* Constructor is used for internal usage only, do not create object from it.
|
|
1853
2015
|
*/
|
|
1854
|
-
constructor(ctx, _id
|
|
2016
|
+
constructor(ctx, _id) {
|
|
1855
2017
|
super(ctx);
|
|
1856
2018
|
this._id = _id;
|
|
1857
|
-
this._name = _name;
|
|
1858
|
-
this._value = _value;
|
|
1859
2019
|
}
|
|
1860
2020
|
/**
|
|
1861
|
-
* A unique identifier for this
|
|
2021
|
+
* A unique identifier for this Env.
|
|
1862
2022
|
*/
|
|
1863
2023
|
id = async () => {
|
|
1864
2024
|
if (this._id) {
|
|
@@ -1869,226 +2029,394 @@ export class EnvVariable extends BaseClient {
|
|
|
1869
2029
|
return response;
|
|
1870
2030
|
};
|
|
1871
2031
|
/**
|
|
1872
|
-
*
|
|
2032
|
+
* retrieve an input value by name
|
|
1873
2033
|
*/
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
}
|
|
1878
|
-
const ctx = this._ctx.select("name");
|
|
1879
|
-
const response = await ctx.execute();
|
|
1880
|
-
return response;
|
|
2034
|
+
input = (name) => {
|
|
2035
|
+
const ctx = this._ctx.select("input", { name });
|
|
2036
|
+
return new Binding(ctx);
|
|
1881
2037
|
};
|
|
1882
2038
|
/**
|
|
1883
|
-
*
|
|
2039
|
+
* return all input values for the environment
|
|
1884
2040
|
*/
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
return this._value;
|
|
1888
|
-
}
|
|
1889
|
-
const ctx = this._ctx.select("value");
|
|
2041
|
+
inputs = async () => {
|
|
2042
|
+
const ctx = this._ctx.select("inputs").select("id");
|
|
1890
2043
|
const response = await ctx.execute();
|
|
1891
|
-
return response;
|
|
2044
|
+
return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
|
|
1892
2045
|
};
|
|
1893
|
-
}
|
|
1894
|
-
export class Error extends BaseClient {
|
|
1895
|
-
_id = undefined;
|
|
1896
|
-
_message = undefined;
|
|
1897
2046
|
/**
|
|
1898
|
-
*
|
|
2047
|
+
* retrieve an output value by name
|
|
1899
2048
|
*/
|
|
1900
|
-
|
|
1901
|
-
|
|
1902
|
-
|
|
1903
|
-
|
|
1904
|
-
}
|
|
2049
|
+
output = (name) => {
|
|
2050
|
+
const ctx = this._ctx.select("output", { name });
|
|
2051
|
+
return new Binding(ctx);
|
|
2052
|
+
};
|
|
1905
2053
|
/**
|
|
1906
|
-
*
|
|
2054
|
+
* return all output values for the environment
|
|
1907
2055
|
*/
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
return this._id;
|
|
1911
|
-
}
|
|
1912
|
-
const ctx = this._ctx.select("id");
|
|
2056
|
+
outputs = async () => {
|
|
2057
|
+
const ctx = this._ctx.select("outputs").select("id");
|
|
1913
2058
|
const response = await ctx.execute();
|
|
1914
|
-
return response;
|
|
2059
|
+
return response.map((r) => new Client(ctx.copy()).loadBindingFromID(r.id));
|
|
1915
2060
|
};
|
|
1916
2061
|
/**
|
|
1917
|
-
*
|
|
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
|
|
1918
2066
|
*/
|
|
1919
|
-
|
|
1920
|
-
|
|
1921
|
-
|
|
1922
|
-
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
return
|
|
2067
|
+
withCacheVolumeInput = (name, value, description) => {
|
|
2068
|
+
const ctx = this._ctx.select("withCacheVolumeInput", {
|
|
2069
|
+
name,
|
|
2070
|
+
value,
|
|
2071
|
+
description,
|
|
2072
|
+
});
|
|
2073
|
+
return new Env(ctx);
|
|
1926
2074
|
};
|
|
1927
2075
|
/**
|
|
1928
|
-
*
|
|
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
|
|
1929
2079
|
*/
|
|
1930
|
-
|
|
1931
|
-
const ctx = this._ctx.select("
|
|
1932
|
-
|
|
1933
|
-
return response.map((r) => new Client(ctx.copy()).loadErrorValueFromID(r.id));
|
|
2080
|
+
withCacheVolumeOutput = (name, description) => {
|
|
2081
|
+
const ctx = this._ctx.select("withCacheVolumeOutput", { name, description });
|
|
2082
|
+
return new Env(ctx);
|
|
1934
2083
|
};
|
|
1935
2084
|
/**
|
|
1936
|
-
*
|
|
1937
|
-
* @param name The name of the
|
|
1938
|
-
* @param value The value to
|
|
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
|
|
1939
2089
|
*/
|
|
1940
|
-
|
|
1941
|
-
const ctx = this._ctx.select("
|
|
1942
|
-
|
|
2090
|
+
withContainerInput = (name, value, description) => {
|
|
2091
|
+
const ctx = this._ctx.select("withContainerInput", {
|
|
2092
|
+
name,
|
|
2093
|
+
value,
|
|
2094
|
+
description,
|
|
2095
|
+
});
|
|
2096
|
+
return new Env(ctx);
|
|
1943
2097
|
};
|
|
1944
2098
|
/**
|
|
1945
|
-
*
|
|
1946
|
-
*
|
|
1947
|
-
*
|
|
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
|
|
1948
2102
|
*/
|
|
1949
|
-
|
|
1950
|
-
|
|
2103
|
+
withContainerOutput = (name, description) => {
|
|
2104
|
+
const ctx = this._ctx.select("withContainerOutput", { name, description });
|
|
2105
|
+
return new Env(ctx);
|
|
1951
2106
|
};
|
|
1952
|
-
}
|
|
1953
|
-
export class ErrorValue extends BaseClient {
|
|
1954
|
-
_id = undefined;
|
|
1955
|
-
_name = undefined;
|
|
1956
|
-
_value = undefined;
|
|
1957
2107
|
/**
|
|
1958
|
-
*
|
|
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
|
|
1959
2112
|
*/
|
|
1960
|
-
|
|
1961
|
-
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
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
|
+
};
|
|
1966
2121
|
/**
|
|
1967
|
-
*
|
|
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
|
|
1968
2125
|
*/
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
}
|
|
1973
|
-
const ctx = this._ctx.select("id");
|
|
1974
|
-
const response = await ctx.execute();
|
|
1975
|
-
return response;
|
|
2126
|
+
withDirectoryOutput = (name, description) => {
|
|
2127
|
+
const ctx = this._ctx.select("withDirectoryOutput", { name, description });
|
|
2128
|
+
return new Env(ctx);
|
|
1976
2129
|
};
|
|
1977
2130
|
/**
|
|
1978
|
-
*
|
|
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
|
|
1979
2135
|
*/
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1983
|
-
}
|
|
1984
|
-
const ctx = this._ctx.select("name");
|
|
1985
|
-
const response = await ctx.execute();
|
|
1986
|
-
return response;
|
|
2136
|
+
withEnvInput = (name, value, description) => {
|
|
2137
|
+
const ctx = this._ctx.select("withEnvInput", { name, value, description });
|
|
2138
|
+
return new Env(ctx);
|
|
1987
2139
|
};
|
|
1988
2140
|
/**
|
|
1989
|
-
*
|
|
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
|
|
1990
2144
|
*/
|
|
1991
|
-
|
|
1992
|
-
|
|
1993
|
-
|
|
1994
|
-
}
|
|
1995
|
-
const ctx = this._ctx.select("value");
|
|
1996
|
-
const response = await ctx.execute();
|
|
1997
|
-
return response;
|
|
2145
|
+
withEnvOutput = (name, description) => {
|
|
2146
|
+
const ctx = this._ctx.select("withEnvOutput", { name, description });
|
|
2147
|
+
return new Env(ctx);
|
|
1998
2148
|
};
|
|
1999
|
-
}
|
|
2000
|
-
/**
|
|
2001
|
-
* A definition of a field on a custom object defined in a Module.
|
|
2002
|
-
*
|
|
2003
|
-
* A field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments).
|
|
2004
|
-
*/
|
|
2005
|
-
export class FieldTypeDef extends BaseClient {
|
|
2006
|
-
_id = undefined;
|
|
2007
|
-
_description = undefined;
|
|
2008
|
-
_name = undefined;
|
|
2009
2149
|
/**
|
|
2010
|
-
*
|
|
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
|
|
2011
2154
|
*/
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
this._name = _name;
|
|
2017
|
-
}
|
|
2155
|
+
withFileInput = (name, value, description) => {
|
|
2156
|
+
const ctx = this._ctx.select("withFileInput", { name, value, description });
|
|
2157
|
+
return new Env(ctx);
|
|
2158
|
+
};
|
|
2018
2159
|
/**
|
|
2019
|
-
*
|
|
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
|
|
2020
2163
|
*/
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
}
|
|
2025
|
-
const ctx = this._ctx.select("id");
|
|
2026
|
-
const response = await ctx.execute();
|
|
2027
|
-
return response;
|
|
2164
|
+
withFileOutput = (name, description) => {
|
|
2165
|
+
const ctx = this._ctx.select("withFileOutput", { name, description });
|
|
2166
|
+
return new Env(ctx);
|
|
2028
2167
|
};
|
|
2029
2168
|
/**
|
|
2030
|
-
*
|
|
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
|
|
2031
2173
|
*/
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
return
|
|
2174
|
+
withGitRefInput = (name, value, description) => {
|
|
2175
|
+
const ctx = this._ctx.select("withGitRefInput", {
|
|
2176
|
+
name,
|
|
2177
|
+
value,
|
|
2178
|
+
description,
|
|
2179
|
+
});
|
|
2180
|
+
return new Env(ctx);
|
|
2039
2181
|
};
|
|
2040
2182
|
/**
|
|
2041
|
-
*
|
|
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
|
|
2042
2186
|
*/
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
}
|
|
2047
|
-
const ctx = this._ctx.select("name");
|
|
2048
|
-
const response = await ctx.execute();
|
|
2049
|
-
return response;
|
|
2187
|
+
withGitRefOutput = (name, description) => {
|
|
2188
|
+
const ctx = this._ctx.select("withGitRefOutput", { name, description });
|
|
2189
|
+
return new Env(ctx);
|
|
2050
2190
|
};
|
|
2051
2191
|
/**
|
|
2052
|
-
*
|
|
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
|
|
2053
2196
|
*/
|
|
2054
|
-
|
|
2055
|
-
const ctx = this._ctx.select("
|
|
2056
|
-
|
|
2197
|
+
withGitRepositoryInput = (name, value, description) => {
|
|
2198
|
+
const ctx = this._ctx.select("withGitRepositoryInput", {
|
|
2199
|
+
name,
|
|
2200
|
+
value,
|
|
2201
|
+
description,
|
|
2202
|
+
});
|
|
2203
|
+
return new Env(ctx);
|
|
2057
2204
|
};
|
|
2058
2205
|
/**
|
|
2059
|
-
*
|
|
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
|
|
2060
2209
|
*/
|
|
2061
|
-
|
|
2062
|
-
const ctx = this._ctx.select("
|
|
2063
|
-
|
|
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);
|
|
2064
2400
|
};
|
|
2065
2401
|
}
|
|
2066
2402
|
/**
|
|
2067
|
-
*
|
|
2403
|
+
* An environment variable name and value.
|
|
2068
2404
|
*/
|
|
2069
|
-
export class
|
|
2405
|
+
export class EnvVariable extends BaseClient {
|
|
2070
2406
|
_id = undefined;
|
|
2071
|
-
_contents = undefined;
|
|
2072
|
-
_digest = undefined;
|
|
2073
|
-
_export = undefined;
|
|
2074
2407
|
_name = undefined;
|
|
2075
|
-
|
|
2076
|
-
_sync = undefined;
|
|
2408
|
+
_value = undefined;
|
|
2077
2409
|
/**
|
|
2078
2410
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2079
2411
|
*/
|
|
2080
|
-
constructor(ctx, _id,
|
|
2412
|
+
constructor(ctx, _id, _name, _value) {
|
|
2081
2413
|
super(ctx);
|
|
2082
2414
|
this._id = _id;
|
|
2083
|
-
this._contents = _contents;
|
|
2084
|
-
this._digest = _digest;
|
|
2085
|
-
this._export = _export;
|
|
2086
2415
|
this._name = _name;
|
|
2087
|
-
this.
|
|
2088
|
-
this._sync = _sync;
|
|
2416
|
+
this._value = _value;
|
|
2089
2417
|
}
|
|
2090
2418
|
/**
|
|
2091
|
-
* A unique identifier for this
|
|
2419
|
+
* A unique identifier for this EnvVariable.
|
|
2092
2420
|
*/
|
|
2093
2421
|
id = async () => {
|
|
2094
2422
|
if (this._id) {
|
|
@@ -2099,91 +2427,80 @@ export class File extends BaseClient {
|
|
|
2099
2427
|
return response;
|
|
2100
2428
|
};
|
|
2101
2429
|
/**
|
|
2102
|
-
*
|
|
2430
|
+
* The environment variable name.
|
|
2103
2431
|
*/
|
|
2104
|
-
|
|
2105
|
-
if (this.
|
|
2106
|
-
return this.
|
|
2432
|
+
name = async () => {
|
|
2433
|
+
if (this._name) {
|
|
2434
|
+
return this._name;
|
|
2107
2435
|
}
|
|
2108
|
-
const ctx = this._ctx.select("
|
|
2436
|
+
const ctx = this._ctx.select("name");
|
|
2109
2437
|
const response = await ctx.execute();
|
|
2110
2438
|
return response;
|
|
2111
2439
|
};
|
|
2112
2440
|
/**
|
|
2113
|
-
*
|
|
2114
|
-
* @param opts.excludeMetadata If true, exclude metadata from the digest.
|
|
2441
|
+
* The environment variable value.
|
|
2115
2442
|
*/
|
|
2116
|
-
|
|
2117
|
-
if (this.
|
|
2118
|
-
return this.
|
|
2443
|
+
value = async () => {
|
|
2444
|
+
if (this._value) {
|
|
2445
|
+
return this._value;
|
|
2119
2446
|
}
|
|
2120
|
-
const ctx = this._ctx.select("
|
|
2447
|
+
const ctx = this._ctx.select("value");
|
|
2121
2448
|
const response = await ctx.execute();
|
|
2122
2449
|
return response;
|
|
2123
2450
|
};
|
|
2451
|
+
}
|
|
2452
|
+
export class Error extends BaseClient {
|
|
2453
|
+
_id = undefined;
|
|
2454
|
+
_message = undefined;
|
|
2124
2455
|
/**
|
|
2125
|
-
*
|
|
2126
|
-
* @param path Location of the written directory (e.g., "output.txt").
|
|
2127
|
-
* @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
|
|
2456
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2128
2457
|
*/
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
const response = await ctx.execute();
|
|
2135
|
-
return response;
|
|
2136
|
-
};
|
|
2458
|
+
constructor(ctx, _id, _message) {
|
|
2459
|
+
super(ctx);
|
|
2460
|
+
this._id = _id;
|
|
2461
|
+
this._message = _message;
|
|
2462
|
+
}
|
|
2137
2463
|
/**
|
|
2138
|
-
*
|
|
2464
|
+
* A unique identifier for this Error.
|
|
2139
2465
|
*/
|
|
2140
|
-
|
|
2141
|
-
if (this.
|
|
2142
|
-
return this.
|
|
2466
|
+
id = async () => {
|
|
2467
|
+
if (this._id) {
|
|
2468
|
+
return this._id;
|
|
2143
2469
|
}
|
|
2144
|
-
const ctx = this._ctx.select("
|
|
2470
|
+
const ctx = this._ctx.select("id");
|
|
2145
2471
|
const response = await ctx.execute();
|
|
2146
2472
|
return response;
|
|
2147
2473
|
};
|
|
2148
2474
|
/**
|
|
2149
|
-
*
|
|
2475
|
+
* A description of the error.
|
|
2150
2476
|
*/
|
|
2151
|
-
|
|
2152
|
-
if (this.
|
|
2153
|
-
return this.
|
|
2477
|
+
message = async () => {
|
|
2478
|
+
if (this._message) {
|
|
2479
|
+
return this._message;
|
|
2154
2480
|
}
|
|
2155
|
-
const ctx = this._ctx.select("
|
|
2481
|
+
const ctx = this._ctx.select("message");
|
|
2156
2482
|
const response = await ctx.execute();
|
|
2157
2483
|
return response;
|
|
2158
2484
|
};
|
|
2159
2485
|
/**
|
|
2160
|
-
*
|
|
2486
|
+
* The extensions of the error.
|
|
2161
2487
|
*/
|
|
2162
|
-
|
|
2163
|
-
const ctx = this._ctx.select("
|
|
2488
|
+
values = async () => {
|
|
2489
|
+
const ctx = this._ctx.select("values").select("id");
|
|
2164
2490
|
const response = await ctx.execute();
|
|
2165
|
-
return new Client(ctx.copy()).
|
|
2166
|
-
};
|
|
2167
|
-
/**
|
|
2168
|
-
* Retrieves this file with its name set to the given name.
|
|
2169
|
-
* @param name Name to set file to.
|
|
2170
|
-
*/
|
|
2171
|
-
withName = (name) => {
|
|
2172
|
-
const ctx = this._ctx.select("withName", { name });
|
|
2173
|
-
return new File(ctx);
|
|
2491
|
+
return response.map((r) => new Client(ctx.copy()).loadErrorValueFromID(r.id));
|
|
2174
2492
|
};
|
|
2175
2493
|
/**
|
|
2176
|
-
*
|
|
2177
|
-
* @param
|
|
2178
|
-
*
|
|
2179
|
-
* Formatted in seconds following Unix epoch (e.g., 1672531199).
|
|
2494
|
+
* Add a value to the error.
|
|
2495
|
+
* @param name The name of the value.
|
|
2496
|
+
* @param value The value to store on the error.
|
|
2180
2497
|
*/
|
|
2181
|
-
|
|
2182
|
-
const ctx = this._ctx.select("
|
|
2183
|
-
return new
|
|
2498
|
+
withValue = (name, value) => {
|
|
2499
|
+
const ctx = this._ctx.select("withValue", { name, value });
|
|
2500
|
+
return new Error(ctx);
|
|
2184
2501
|
};
|
|
2185
2502
|
/**
|
|
2186
|
-
* Call the provided function with current
|
|
2503
|
+
* Call the provided function with current Error.
|
|
2187
2504
|
*
|
|
2188
2505
|
* This is useful for reusability and readability by not breaking the calling chain.
|
|
2189
2506
|
*/
|
|
@@ -2191,26 +2508,21 @@ export class File extends BaseClient {
|
|
|
2191
2508
|
return arg(this);
|
|
2192
2509
|
};
|
|
2193
2510
|
}
|
|
2194
|
-
|
|
2195
|
-
* Function represents a resolver provided by a Module.
|
|
2196
|
-
*
|
|
2197
|
-
* A function always evaluates against a parent object and is given a set of named arguments.
|
|
2198
|
-
*/
|
|
2199
|
-
export class Function_ extends BaseClient {
|
|
2511
|
+
export class ErrorValue extends BaseClient {
|
|
2200
2512
|
_id = undefined;
|
|
2201
|
-
_description = undefined;
|
|
2202
2513
|
_name = undefined;
|
|
2514
|
+
_value = undefined;
|
|
2203
2515
|
/**
|
|
2204
2516
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2205
2517
|
*/
|
|
2206
|
-
constructor(ctx, _id,
|
|
2518
|
+
constructor(ctx, _id, _name, _value) {
|
|
2207
2519
|
super(ctx);
|
|
2208
2520
|
this._id = _id;
|
|
2209
|
-
this._description = _description;
|
|
2210
2521
|
this._name = _name;
|
|
2522
|
+
this._value = _value;
|
|
2211
2523
|
}
|
|
2212
2524
|
/**
|
|
2213
|
-
* A unique identifier for this
|
|
2525
|
+
* A unique identifier for this ErrorValue.
|
|
2214
2526
|
*/
|
|
2215
2527
|
id = async () => {
|
|
2216
2528
|
if (this._id) {
|
|
@@ -2221,26 +2533,7 @@ export class Function_ extends BaseClient {
|
|
|
2221
2533
|
return response;
|
|
2222
2534
|
};
|
|
2223
2535
|
/**
|
|
2224
|
-
*
|
|
2225
|
-
*/
|
|
2226
|
-
args = async () => {
|
|
2227
|
-
const ctx = this._ctx.select("args").select("id");
|
|
2228
|
-
const response = await ctx.execute();
|
|
2229
|
-
return response.map((r) => new Client(ctx.copy()).loadFunctionArgFromID(r.id));
|
|
2230
|
-
};
|
|
2231
|
-
/**
|
|
2232
|
-
* A doc string for the function, if any.
|
|
2233
|
-
*/
|
|
2234
|
-
description = async () => {
|
|
2235
|
-
if (this._description) {
|
|
2236
|
-
return this._description;
|
|
2237
|
-
}
|
|
2238
|
-
const ctx = this._ctx.select("description");
|
|
2239
|
-
const response = await ctx.execute();
|
|
2240
|
-
return response;
|
|
2241
|
-
};
|
|
2242
|
-
/**
|
|
2243
|
-
* The name of the function.
|
|
2536
|
+
* The name of the value.
|
|
2244
2537
|
*/
|
|
2245
2538
|
name = async () => {
|
|
2246
2539
|
if (this._name) {
|
|
@@ -2251,14 +2544,279 @@ export class Function_ extends BaseClient {
|
|
|
2251
2544
|
return response;
|
|
2252
2545
|
};
|
|
2253
2546
|
/**
|
|
2254
|
-
* The
|
|
2547
|
+
* The value.
|
|
2255
2548
|
*/
|
|
2256
|
-
|
|
2257
|
-
|
|
2258
|
-
|
|
2549
|
+
value = async () => {
|
|
2550
|
+
if (this._value) {
|
|
2551
|
+
return this._value;
|
|
2552
|
+
}
|
|
2553
|
+
const ctx = this._ctx.select("value");
|
|
2554
|
+
const response = await ctx.execute();
|
|
2555
|
+
return response;
|
|
2259
2556
|
};
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* A definition of a field on a custom object defined in a Module.
|
|
2560
|
+
*
|
|
2561
|
+
* A field on an object has a static value, as opposed to a function on an object whose value is computed by invoking code (and can accept arguments).
|
|
2562
|
+
*/
|
|
2563
|
+
export class FieldTypeDef extends BaseClient {
|
|
2564
|
+
_id = undefined;
|
|
2565
|
+
_description = undefined;
|
|
2566
|
+
_name = undefined;
|
|
2260
2567
|
/**
|
|
2261
|
-
*
|
|
2568
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2569
|
+
*/
|
|
2570
|
+
constructor(ctx, _id, _description, _name) {
|
|
2571
|
+
super(ctx);
|
|
2572
|
+
this._id = _id;
|
|
2573
|
+
this._description = _description;
|
|
2574
|
+
this._name = _name;
|
|
2575
|
+
}
|
|
2576
|
+
/**
|
|
2577
|
+
* A unique identifier for this FieldTypeDef.
|
|
2578
|
+
*/
|
|
2579
|
+
id = async () => {
|
|
2580
|
+
if (this._id) {
|
|
2581
|
+
return this._id;
|
|
2582
|
+
}
|
|
2583
|
+
const ctx = this._ctx.select("id");
|
|
2584
|
+
const response = await ctx.execute();
|
|
2585
|
+
return response;
|
|
2586
|
+
};
|
|
2587
|
+
/**
|
|
2588
|
+
* A doc string for the field, if any.
|
|
2589
|
+
*/
|
|
2590
|
+
description = async () => {
|
|
2591
|
+
if (this._description) {
|
|
2592
|
+
return this._description;
|
|
2593
|
+
}
|
|
2594
|
+
const ctx = this._ctx.select("description");
|
|
2595
|
+
const response = await ctx.execute();
|
|
2596
|
+
return response;
|
|
2597
|
+
};
|
|
2598
|
+
/**
|
|
2599
|
+
* The name of the field in lowerCamelCase format.
|
|
2600
|
+
*/
|
|
2601
|
+
name = async () => {
|
|
2602
|
+
if (this._name) {
|
|
2603
|
+
return this._name;
|
|
2604
|
+
}
|
|
2605
|
+
const ctx = this._ctx.select("name");
|
|
2606
|
+
const response = await ctx.execute();
|
|
2607
|
+
return response;
|
|
2608
|
+
};
|
|
2609
|
+
/**
|
|
2610
|
+
* The location of this field declaration.
|
|
2611
|
+
*/
|
|
2612
|
+
sourceMap = () => {
|
|
2613
|
+
const ctx = this._ctx.select("sourceMap");
|
|
2614
|
+
return new SourceMap(ctx);
|
|
2615
|
+
};
|
|
2616
|
+
/**
|
|
2617
|
+
* The type of the field.
|
|
2618
|
+
*/
|
|
2619
|
+
typeDef = () => {
|
|
2620
|
+
const ctx = this._ctx.select("typeDef");
|
|
2621
|
+
return new TypeDef(ctx);
|
|
2622
|
+
};
|
|
2623
|
+
}
|
|
2624
|
+
/**
|
|
2625
|
+
* A file.
|
|
2626
|
+
*/
|
|
2627
|
+
export class File extends BaseClient {
|
|
2628
|
+
_id = undefined;
|
|
2629
|
+
_contents = undefined;
|
|
2630
|
+
_digest = undefined;
|
|
2631
|
+
_export = undefined;
|
|
2632
|
+
_name = undefined;
|
|
2633
|
+
_size = undefined;
|
|
2634
|
+
_sync = undefined;
|
|
2635
|
+
/**
|
|
2636
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2637
|
+
*/
|
|
2638
|
+
constructor(ctx, _id, _contents, _digest, _export, _name, _size, _sync) {
|
|
2639
|
+
super(ctx);
|
|
2640
|
+
this._id = _id;
|
|
2641
|
+
this._contents = _contents;
|
|
2642
|
+
this._digest = _digest;
|
|
2643
|
+
this._export = _export;
|
|
2644
|
+
this._name = _name;
|
|
2645
|
+
this._size = _size;
|
|
2646
|
+
this._sync = _sync;
|
|
2647
|
+
}
|
|
2648
|
+
/**
|
|
2649
|
+
* A unique identifier for this File.
|
|
2650
|
+
*/
|
|
2651
|
+
id = async () => {
|
|
2652
|
+
if (this._id) {
|
|
2653
|
+
return this._id;
|
|
2654
|
+
}
|
|
2655
|
+
const ctx = this._ctx.select("id");
|
|
2656
|
+
const response = await ctx.execute();
|
|
2657
|
+
return response;
|
|
2658
|
+
};
|
|
2659
|
+
/**
|
|
2660
|
+
* Retrieves the contents of the file.
|
|
2661
|
+
*/
|
|
2662
|
+
contents = async () => {
|
|
2663
|
+
if (this._contents) {
|
|
2664
|
+
return this._contents;
|
|
2665
|
+
}
|
|
2666
|
+
const ctx = this._ctx.select("contents");
|
|
2667
|
+
const response = await ctx.execute();
|
|
2668
|
+
return response;
|
|
2669
|
+
};
|
|
2670
|
+
/**
|
|
2671
|
+
* Return the file's digest. The format of the digest is not guaranteed to be stable between releases of Dagger. It is guaranteed to be stable between invocations of the same Dagger engine.
|
|
2672
|
+
* @param opts.excludeMetadata If true, exclude metadata from the digest.
|
|
2673
|
+
*/
|
|
2674
|
+
digest = async (opts) => {
|
|
2675
|
+
if (this._digest) {
|
|
2676
|
+
return this._digest;
|
|
2677
|
+
}
|
|
2678
|
+
const ctx = this._ctx.select("digest", { ...opts });
|
|
2679
|
+
const response = await ctx.execute();
|
|
2680
|
+
return response;
|
|
2681
|
+
};
|
|
2682
|
+
/**
|
|
2683
|
+
* Writes the file to a file path on the host.
|
|
2684
|
+
* @param path Location of the written directory (e.g., "output.txt").
|
|
2685
|
+
* @param opts.allowParentDirPath If allowParentDirPath is true, the path argument can be a directory path, in which case the file will be created in that directory.
|
|
2686
|
+
*/
|
|
2687
|
+
export = async (path, opts) => {
|
|
2688
|
+
if (this._export) {
|
|
2689
|
+
return this._export;
|
|
2690
|
+
}
|
|
2691
|
+
const ctx = this._ctx.select("export", { path, ...opts });
|
|
2692
|
+
const response = await ctx.execute();
|
|
2693
|
+
return response;
|
|
2694
|
+
};
|
|
2695
|
+
/**
|
|
2696
|
+
* Retrieves the name of the file.
|
|
2697
|
+
*/
|
|
2698
|
+
name = async () => {
|
|
2699
|
+
if (this._name) {
|
|
2700
|
+
return this._name;
|
|
2701
|
+
}
|
|
2702
|
+
const ctx = this._ctx.select("name");
|
|
2703
|
+
const response = await ctx.execute();
|
|
2704
|
+
return response;
|
|
2705
|
+
};
|
|
2706
|
+
/**
|
|
2707
|
+
* Retrieves the size of the file, in bytes.
|
|
2708
|
+
*/
|
|
2709
|
+
size = async () => {
|
|
2710
|
+
if (this._size) {
|
|
2711
|
+
return this._size;
|
|
2712
|
+
}
|
|
2713
|
+
const ctx = this._ctx.select("size");
|
|
2714
|
+
const response = await ctx.execute();
|
|
2715
|
+
return response;
|
|
2716
|
+
};
|
|
2717
|
+
/**
|
|
2718
|
+
* Force evaluation in the engine.
|
|
2719
|
+
*/
|
|
2720
|
+
sync = async () => {
|
|
2721
|
+
const ctx = this._ctx.select("sync");
|
|
2722
|
+
const response = await ctx.execute();
|
|
2723
|
+
return new Client(ctx.copy()).loadFileFromID(response);
|
|
2724
|
+
};
|
|
2725
|
+
/**
|
|
2726
|
+
* Retrieves this file with its name set to the given name.
|
|
2727
|
+
* @param name Name to set file to.
|
|
2728
|
+
*/
|
|
2729
|
+
withName = (name) => {
|
|
2730
|
+
const ctx = this._ctx.select("withName", { name });
|
|
2731
|
+
return new File(ctx);
|
|
2732
|
+
};
|
|
2733
|
+
/**
|
|
2734
|
+
* Retrieves this file with its created/modified timestamps set to the given time.
|
|
2735
|
+
* @param timestamp Timestamp to set dir/files in.
|
|
2736
|
+
*
|
|
2737
|
+
* Formatted in seconds following Unix epoch (e.g., 1672531199).
|
|
2738
|
+
*/
|
|
2739
|
+
withTimestamps = (timestamp) => {
|
|
2740
|
+
const ctx = this._ctx.select("withTimestamps", { timestamp });
|
|
2741
|
+
return new File(ctx);
|
|
2742
|
+
};
|
|
2743
|
+
/**
|
|
2744
|
+
* Call the provided function with current File.
|
|
2745
|
+
*
|
|
2746
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
2747
|
+
*/
|
|
2748
|
+
with = (arg) => {
|
|
2749
|
+
return arg(this);
|
|
2750
|
+
};
|
|
2751
|
+
}
|
|
2752
|
+
/**
|
|
2753
|
+
* Function represents a resolver provided by a Module.
|
|
2754
|
+
*
|
|
2755
|
+
* A function always evaluates against a parent object and is given a set of named arguments.
|
|
2756
|
+
*/
|
|
2757
|
+
export class Function_ extends BaseClient {
|
|
2758
|
+
_id = undefined;
|
|
2759
|
+
_description = undefined;
|
|
2760
|
+
_name = undefined;
|
|
2761
|
+
/**
|
|
2762
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2763
|
+
*/
|
|
2764
|
+
constructor(ctx, _id, _description, _name) {
|
|
2765
|
+
super(ctx);
|
|
2766
|
+
this._id = _id;
|
|
2767
|
+
this._description = _description;
|
|
2768
|
+
this._name = _name;
|
|
2769
|
+
}
|
|
2770
|
+
/**
|
|
2771
|
+
* A unique identifier for this Function.
|
|
2772
|
+
*/
|
|
2773
|
+
id = async () => {
|
|
2774
|
+
if (this._id) {
|
|
2775
|
+
return this._id;
|
|
2776
|
+
}
|
|
2777
|
+
const ctx = this._ctx.select("id");
|
|
2778
|
+
const response = await ctx.execute();
|
|
2779
|
+
return response;
|
|
2780
|
+
};
|
|
2781
|
+
/**
|
|
2782
|
+
* Arguments accepted by the function, if any.
|
|
2783
|
+
*/
|
|
2784
|
+
args = async () => {
|
|
2785
|
+
const ctx = this._ctx.select("args").select("id");
|
|
2786
|
+
const response = await ctx.execute();
|
|
2787
|
+
return response.map((r) => new Client(ctx.copy()).loadFunctionArgFromID(r.id));
|
|
2788
|
+
};
|
|
2789
|
+
/**
|
|
2790
|
+
* A doc string for the function, if any.
|
|
2791
|
+
*/
|
|
2792
|
+
description = async () => {
|
|
2793
|
+
if (this._description) {
|
|
2794
|
+
return this._description;
|
|
2795
|
+
}
|
|
2796
|
+
const ctx = this._ctx.select("description");
|
|
2797
|
+
const response = await ctx.execute();
|
|
2798
|
+
return response;
|
|
2799
|
+
};
|
|
2800
|
+
/**
|
|
2801
|
+
* The name of the function.
|
|
2802
|
+
*/
|
|
2803
|
+
name = async () => {
|
|
2804
|
+
if (this._name) {
|
|
2805
|
+
return this._name;
|
|
2806
|
+
}
|
|
2807
|
+
const ctx = this._ctx.select("name");
|
|
2808
|
+
const response = await ctx.execute();
|
|
2809
|
+
return response;
|
|
2810
|
+
};
|
|
2811
|
+
/**
|
|
2812
|
+
* The type returned by the function.
|
|
2813
|
+
*/
|
|
2814
|
+
returnType = () => {
|
|
2815
|
+
const ctx = this._ctx.select("returnType");
|
|
2816
|
+
return new TypeDef(ctx);
|
|
2817
|
+
};
|
|
2818
|
+
/**
|
|
2819
|
+
* The location of this function declaration.
|
|
2262
2820
|
*/
|
|
2263
2821
|
sourceMap = () => {
|
|
2264
2822
|
const ctx = this._ctx.select("sourceMap");
|
|
@@ -2877,1218 +3435,251 @@ export class InputTypeDef extends BaseClient {
|
|
|
2877
3435
|
}
|
|
2878
3436
|
const ctx = this._ctx.select("id");
|
|
2879
3437
|
const response = await ctx.execute();
|
|
2880
|
-
return response;
|
|
2881
|
-
};
|
|
2882
|
-
/**
|
|
2883
|
-
* Static fields defined on this input object, if any.
|
|
2884
|
-
*/
|
|
2885
|
-
fields = async () => {
|
|
2886
|
-
const ctx = this._ctx.select("fields").select("id");
|
|
2887
|
-
const response = await ctx.execute();
|
|
2888
|
-
return response.map((r) => new Client(ctx.copy()).loadFieldTypeDefFromID(r.id));
|
|
2889
|
-
};
|
|
2890
|
-
/**
|
|
2891
|
-
* The name of the input object.
|
|
2892
|
-
*/
|
|
2893
|
-
name = async () => {
|
|
2894
|
-
if (this._name) {
|
|
2895
|
-
return this._name;
|
|
2896
|
-
}
|
|
2897
|
-
const ctx = this._ctx.select("name");
|
|
2898
|
-
const response = await ctx.execute();
|
|
2899
|
-
return response;
|
|
2900
|
-
};
|
|
2901
|
-
}
|
|
2902
|
-
/**
|
|
2903
|
-
* A definition of a custom interface defined in a Module.
|
|
2904
|
-
*/
|
|
2905
|
-
export class InterfaceTypeDef extends BaseClient {
|
|
2906
|
-
_id = undefined;
|
|
2907
|
-
_description = undefined;
|
|
2908
|
-
_name = undefined;
|
|
2909
|
-
_sourceModuleName = undefined;
|
|
2910
|
-
/**
|
|
2911
|
-
* Constructor is used for internal usage only, do not create object from it.
|
|
2912
|
-
*/
|
|
2913
|
-
constructor(ctx, _id, _description, _name, _sourceModuleName) {
|
|
2914
|
-
super(ctx);
|
|
2915
|
-
this._id = _id;
|
|
2916
|
-
this._description = _description;
|
|
2917
|
-
this._name = _name;
|
|
2918
|
-
this._sourceModuleName = _sourceModuleName;
|
|
2919
|
-
}
|
|
2920
|
-
/**
|
|
2921
|
-
* A unique identifier for this InterfaceTypeDef.
|
|
2922
|
-
*/
|
|
2923
|
-
id = async () => {
|
|
2924
|
-
if (this._id) {
|
|
2925
|
-
return this._id;
|
|
2926
|
-
}
|
|
2927
|
-
const ctx = this._ctx.select("id");
|
|
2928
|
-
const response = await ctx.execute();
|
|
2929
|
-
return response;
|
|
2930
|
-
};
|
|
2931
|
-
/**
|
|
2932
|
-
* The doc string for the interface, if any.
|
|
2933
|
-
*/
|
|
2934
|
-
description = async () => {
|
|
2935
|
-
if (this._description) {
|
|
2936
|
-
return this._description;
|
|
2937
|
-
}
|
|
2938
|
-
const ctx = this._ctx.select("description");
|
|
2939
|
-
const response = await ctx.execute();
|
|
2940
|
-
return response;
|
|
2941
|
-
};
|
|
2942
|
-
/**
|
|
2943
|
-
* Functions defined on this interface, if any.
|
|
2944
|
-
*/
|
|
2945
|
-
functions = async () => {
|
|
2946
|
-
const ctx = this._ctx.select("functions").select("id");
|
|
2947
|
-
const response = await ctx.execute();
|
|
2948
|
-
return response.map((r) => new Client(ctx.copy()).loadFunctionFromID(r.id));
|
|
2949
|
-
};
|
|
2950
|
-
/**
|
|
2951
|
-
* The name of the interface.
|
|
2952
|
-
*/
|
|
2953
|
-
name = async () => {
|
|
2954
|
-
if (this._name) {
|
|
2955
|
-
return this._name;
|
|
2956
|
-
}
|
|
2957
|
-
const ctx = this._ctx.select("name");
|
|
2958
|
-
const response = await ctx.execute();
|
|
2959
|
-
return response;
|
|
2960
|
-
};
|
|
2961
|
-
/**
|
|
2962
|
-
* The location of this interface declaration.
|
|
2963
|
-
*/
|
|
2964
|
-
sourceMap = () => {
|
|
2965
|
-
const ctx = this._ctx.select("sourceMap");
|
|
2966
|
-
return new SourceMap(ctx);
|
|
2967
|
-
};
|
|
2968
|
-
/**
|
|
2969
|
-
* If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
2970
|
-
*/
|
|
2971
|
-
sourceModuleName = async () => {
|
|
2972
|
-
if (this._sourceModuleName) {
|
|
2973
|
-
return this._sourceModuleName;
|
|
2974
|
-
}
|
|
2975
|
-
const ctx = this._ctx.select("sourceModuleName");
|
|
2976
|
-
const response = await ctx.execute();
|
|
2977
|
-
return response;
|
|
2978
|
-
};
|
|
2979
|
-
}
|
|
2980
|
-
export class LLM extends BaseClient {
|
|
2981
|
-
_id = undefined;
|
|
2982
|
-
_currentType = undefined;
|
|
2983
|
-
_getString = undefined;
|
|
2984
|
-
_historyJSON = undefined;
|
|
2985
|
-
_lastReply = undefined;
|
|
2986
|
-
_model = undefined;
|
|
2987
|
-
_provider = undefined;
|
|
2988
|
-
_sync = undefined;
|
|
2989
|
-
_tools = undefined;
|
|
2990
|
-
/**
|
|
2991
|
-
* Constructor is used for internal usage only, do not create object from it.
|
|
2992
|
-
*/
|
|
2993
|
-
constructor(ctx, _id, _currentType, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
|
|
2994
|
-
super(ctx);
|
|
2995
|
-
this._id = _id;
|
|
2996
|
-
this._currentType = _currentType;
|
|
2997
|
-
this._getString = _getString;
|
|
2998
|
-
this._historyJSON = _historyJSON;
|
|
2999
|
-
this._lastReply = _lastReply;
|
|
3000
|
-
this._model = _model;
|
|
3001
|
-
this._provider = _provider;
|
|
3002
|
-
this._sync = _sync;
|
|
3003
|
-
this._tools = _tools;
|
|
3004
|
-
}
|
|
3005
|
-
/**
|
|
3006
|
-
* A unique identifier for this LLM.
|
|
3007
|
-
*/
|
|
3008
|
-
id = async () => {
|
|
3009
|
-
if (this._id) {
|
|
3010
|
-
return this._id;
|
|
3011
|
-
}
|
|
3012
|
-
const ctx = this._ctx.select("id");
|
|
3013
|
-
const response = await ctx.execute();
|
|
3014
|
-
return response;
|
|
3015
|
-
};
|
|
3016
|
-
/**
|
|
3017
|
-
* Retrieve a the current value in the LLM environment, of type CacheVolume
|
|
3018
|
-
*/
|
|
3019
|
-
cacheVolume = () => {
|
|
3020
|
-
const ctx = this._ctx.select("cacheVolume");
|
|
3021
|
-
return new CacheVolume(ctx);
|
|
3022
|
-
};
|
|
3023
|
-
/**
|
|
3024
|
-
* Retrieve a the current value in the LLM environment, of type Container
|
|
3025
|
-
*/
|
|
3026
|
-
container = () => {
|
|
3027
|
-
const ctx = this._ctx.select("container");
|
|
3028
|
-
return new Container(ctx);
|
|
3029
|
-
};
|
|
3030
|
-
/**
|
|
3031
|
-
* Retrieve a the current value in the LLM environment, of type CurrentModule
|
|
3032
|
-
*/
|
|
3033
|
-
currentModule = () => {
|
|
3034
|
-
const ctx = this._ctx.select("currentModule");
|
|
3035
|
-
return new CurrentModule(ctx);
|
|
3036
|
-
};
|
|
3037
|
-
/**
|
|
3038
|
-
* returns the type of the current state
|
|
3039
|
-
*/
|
|
3040
|
-
currentType = async () => {
|
|
3041
|
-
if (this._currentType) {
|
|
3042
|
-
return this._currentType;
|
|
3043
|
-
}
|
|
3044
|
-
const ctx = this._ctx.select("currentType");
|
|
3045
|
-
const response = await ctx.execute();
|
|
3046
|
-
return response;
|
|
3047
|
-
};
|
|
3048
|
-
/**
|
|
3049
|
-
* Retrieve a the current value in the LLM environment, of type Directory
|
|
3050
|
-
*/
|
|
3051
|
-
directory = () => {
|
|
3052
|
-
const ctx = this._ctx.select("directory");
|
|
3053
|
-
return new Directory(ctx);
|
|
3054
|
-
};
|
|
3055
|
-
/**
|
|
3056
|
-
* Retrieve a the current value in the LLM environment, of type EnumTypeDef
|
|
3057
|
-
*/
|
|
3058
|
-
enumTypeDef = () => {
|
|
3059
|
-
const ctx = this._ctx.select("enumTypeDef");
|
|
3060
|
-
return new EnumTypeDef(ctx);
|
|
3061
|
-
};
|
|
3062
|
-
/**
|
|
3063
|
-
* Retrieve a the current value in the LLM environment, of type EnumValueTypeDef
|
|
3064
|
-
*/
|
|
3065
|
-
enumValueTypeDef = () => {
|
|
3066
|
-
const ctx = this._ctx.select("enumValueTypeDef");
|
|
3067
|
-
return new EnumValueTypeDef(ctx);
|
|
3068
|
-
};
|
|
3069
|
-
/**
|
|
3070
|
-
* Retrieve a the current value in the LLM environment, of type Error
|
|
3071
|
-
*/
|
|
3072
|
-
error = () => {
|
|
3073
|
-
const ctx = this._ctx.select("error");
|
|
3074
|
-
return new Error(ctx);
|
|
3075
|
-
};
|
|
3076
|
-
/**
|
|
3077
|
-
* Retrieve a the current value in the LLM environment, of type ErrorValue
|
|
3078
|
-
*/
|
|
3079
|
-
errorValue = () => {
|
|
3080
|
-
const ctx = this._ctx.select("errorValue");
|
|
3081
|
-
return new ErrorValue(ctx);
|
|
3082
|
-
};
|
|
3083
|
-
/**
|
|
3084
|
-
* Retrieve a the current value in the LLM environment, of type FieldTypeDef
|
|
3085
|
-
*/
|
|
3086
|
-
fieldTypeDef = () => {
|
|
3087
|
-
const ctx = this._ctx.select("fieldTypeDef");
|
|
3088
|
-
return new FieldTypeDef(ctx);
|
|
3089
|
-
};
|
|
3090
|
-
/**
|
|
3091
|
-
* Retrieve a the current value in the LLM environment, of type File
|
|
3092
|
-
*/
|
|
3093
|
-
file = () => {
|
|
3094
|
-
const ctx = this._ctx.select("file");
|
|
3095
|
-
return new File(ctx);
|
|
3096
|
-
};
|
|
3097
|
-
/**
|
|
3098
|
-
* Retrieve a the current value in the LLM environment, of type Function
|
|
3099
|
-
*/
|
|
3100
|
-
function_ = () => {
|
|
3101
|
-
const ctx = this._ctx.select("function");
|
|
3102
|
-
return new Function_(ctx);
|
|
3103
|
-
};
|
|
3104
|
-
/**
|
|
3105
|
-
* Retrieve a the current value in the LLM environment, of type FunctionArg
|
|
3106
|
-
*/
|
|
3107
|
-
functionArg = () => {
|
|
3108
|
-
const ctx = this._ctx.select("functionArg");
|
|
3109
|
-
return new FunctionArg(ctx);
|
|
3110
|
-
};
|
|
3111
|
-
/**
|
|
3112
|
-
* Retrieve a the current value in the LLM environment, of type FunctionCall
|
|
3113
|
-
*/
|
|
3114
|
-
functionCall = () => {
|
|
3115
|
-
const ctx = this._ctx.select("functionCall");
|
|
3116
|
-
return new FunctionCall(ctx);
|
|
3117
|
-
};
|
|
3118
|
-
/**
|
|
3119
|
-
* Retrieve a the current value in the LLM environment, of type FunctionCallArgValue
|
|
3120
|
-
*/
|
|
3121
|
-
functionCallArgValue = () => {
|
|
3122
|
-
const ctx = this._ctx.select("functionCallArgValue");
|
|
3123
|
-
return new FunctionCallArgValue(ctx);
|
|
3124
|
-
};
|
|
3125
|
-
/**
|
|
3126
|
-
* Retrieve a the current value in the LLM environment, of type GeneratedCode
|
|
3127
|
-
*/
|
|
3128
|
-
generatedCode = () => {
|
|
3129
|
-
const ctx = this._ctx.select("generatedCode");
|
|
3130
|
-
return new GeneratedCode(ctx);
|
|
3131
|
-
};
|
|
3132
|
-
/**
|
|
3133
|
-
* Retrieve a variable in the llm environment, of type CacheVolume
|
|
3134
|
-
* @param name The name of the variable
|
|
3135
|
-
*/
|
|
3136
|
-
getCacheVolume = (name) => {
|
|
3137
|
-
const ctx = this._ctx.select("getCacheVolume", { name });
|
|
3138
|
-
return new CacheVolume(ctx);
|
|
3139
|
-
};
|
|
3140
|
-
/**
|
|
3141
|
-
* Retrieve a variable in the llm environment, of type Container
|
|
3142
|
-
* @param name The name of the variable
|
|
3143
|
-
*/
|
|
3144
|
-
getContainer = (name) => {
|
|
3145
|
-
const ctx = this._ctx.select("getContainer", { name });
|
|
3146
|
-
return new Container(ctx);
|
|
3147
|
-
};
|
|
3148
|
-
/**
|
|
3149
|
-
* Retrieve a variable in the llm environment, of type CurrentModule
|
|
3150
|
-
* @param name The name of the variable
|
|
3151
|
-
*/
|
|
3152
|
-
getCurrentModule = (name) => {
|
|
3153
|
-
const ctx = this._ctx.select("getCurrentModule", { name });
|
|
3154
|
-
return new CurrentModule(ctx);
|
|
3155
|
-
};
|
|
3156
|
-
/**
|
|
3157
|
-
* Retrieve a variable in the llm environment, of type Directory
|
|
3158
|
-
* @param name The name of the variable
|
|
3159
|
-
*/
|
|
3160
|
-
getDirectory = (name) => {
|
|
3161
|
-
const ctx = this._ctx.select("getDirectory", { name });
|
|
3162
|
-
return new Directory(ctx);
|
|
3163
|
-
};
|
|
3164
|
-
/**
|
|
3165
|
-
* Retrieve a variable in the llm environment, of type EnumTypeDef
|
|
3166
|
-
* @param name The name of the variable
|
|
3167
|
-
*/
|
|
3168
|
-
getEnumTypeDef = (name) => {
|
|
3169
|
-
const ctx = this._ctx.select("getEnumTypeDef", { name });
|
|
3170
|
-
return new EnumTypeDef(ctx);
|
|
3171
|
-
};
|
|
3172
|
-
/**
|
|
3173
|
-
* Retrieve a variable in the llm environment, of type EnumValueTypeDef
|
|
3174
|
-
* @param name The name of the variable
|
|
3175
|
-
*/
|
|
3176
|
-
getEnumValueTypeDef = (name) => {
|
|
3177
|
-
const ctx = this._ctx.select("getEnumValueTypeDef", { name });
|
|
3178
|
-
return new EnumValueTypeDef(ctx);
|
|
3179
|
-
};
|
|
3180
|
-
/**
|
|
3181
|
-
* Retrieve a variable in the llm environment, of type Error
|
|
3182
|
-
* @param name The name of the variable
|
|
3183
|
-
*/
|
|
3184
|
-
getError = (name) => {
|
|
3185
|
-
const ctx = this._ctx.select("getError", { name });
|
|
3186
|
-
return new Error(ctx);
|
|
3187
|
-
};
|
|
3188
|
-
/**
|
|
3189
|
-
* Retrieve a variable in the llm environment, of type ErrorValue
|
|
3190
|
-
* @param name The name of the variable
|
|
3191
|
-
*/
|
|
3192
|
-
getErrorValue = (name) => {
|
|
3193
|
-
const ctx = this._ctx.select("getErrorValue", { name });
|
|
3194
|
-
return new ErrorValue(ctx);
|
|
3195
|
-
};
|
|
3196
|
-
/**
|
|
3197
|
-
* Retrieve a variable in the llm environment, of type FieldTypeDef
|
|
3198
|
-
* @param name The name of the variable
|
|
3199
|
-
*/
|
|
3200
|
-
getFieldTypeDef = (name) => {
|
|
3201
|
-
const ctx = this._ctx.select("getFieldTypeDef", { name });
|
|
3202
|
-
return new FieldTypeDef(ctx);
|
|
3203
|
-
};
|
|
3204
|
-
/**
|
|
3205
|
-
* Retrieve a variable in the llm environment, of type File
|
|
3206
|
-
* @param name The name of the variable
|
|
3207
|
-
*/
|
|
3208
|
-
getFile = (name) => {
|
|
3209
|
-
const ctx = this._ctx.select("getFile", { name });
|
|
3210
|
-
return new File(ctx);
|
|
3211
|
-
};
|
|
3212
|
-
/**
|
|
3213
|
-
* Retrieve a variable in the llm environment, of type Function
|
|
3214
|
-
* @param name The name of the variable
|
|
3215
|
-
*/
|
|
3216
|
-
getFunction = (name) => {
|
|
3217
|
-
const ctx = this._ctx.select("getFunction", { name });
|
|
3218
|
-
return new Function_(ctx);
|
|
3219
|
-
};
|
|
3220
|
-
/**
|
|
3221
|
-
* Retrieve a variable in the llm environment, of type FunctionArg
|
|
3222
|
-
* @param name The name of the variable
|
|
3223
|
-
*/
|
|
3224
|
-
getFunctionArg = (name) => {
|
|
3225
|
-
const ctx = this._ctx.select("getFunctionArg", { name });
|
|
3226
|
-
return new FunctionArg(ctx);
|
|
3227
|
-
};
|
|
3228
|
-
/**
|
|
3229
|
-
* Retrieve a variable in the llm environment, of type FunctionCall
|
|
3230
|
-
* @param name The name of the variable
|
|
3231
|
-
*/
|
|
3232
|
-
getFunctionCall = (name) => {
|
|
3233
|
-
const ctx = this._ctx.select("getFunctionCall", { name });
|
|
3234
|
-
return new FunctionCall(ctx);
|
|
3235
|
-
};
|
|
3236
|
-
/**
|
|
3237
|
-
* Retrieve a variable in the llm environment, of type FunctionCallArgValue
|
|
3238
|
-
* @param name The name of the variable
|
|
3239
|
-
*/
|
|
3240
|
-
getFunctionCallArgValue = (name) => {
|
|
3241
|
-
const ctx = this._ctx.select("getFunctionCallArgValue", { name });
|
|
3242
|
-
return new FunctionCallArgValue(ctx);
|
|
3243
|
-
};
|
|
3244
|
-
/**
|
|
3245
|
-
* Retrieve a variable in the llm environment, of type GeneratedCode
|
|
3246
|
-
* @param name The name of the variable
|
|
3247
|
-
*/
|
|
3248
|
-
getGeneratedCode = (name) => {
|
|
3249
|
-
const ctx = this._ctx.select("getGeneratedCode", { name });
|
|
3250
|
-
return new GeneratedCode(ctx);
|
|
3251
|
-
};
|
|
3252
|
-
/**
|
|
3253
|
-
* Retrieve a variable in the llm environment, of type GitRef
|
|
3254
|
-
* @param name The name of the variable
|
|
3255
|
-
*/
|
|
3256
|
-
getGitRef = (name) => {
|
|
3257
|
-
const ctx = this._ctx.select("getGitRef", { name });
|
|
3258
|
-
return new GitRef(ctx);
|
|
3259
|
-
};
|
|
3260
|
-
/**
|
|
3261
|
-
* Retrieve a variable in the llm environment, of type GitRepository
|
|
3262
|
-
* @param name The name of the variable
|
|
3263
|
-
*/
|
|
3264
|
-
getGitRepository = (name) => {
|
|
3265
|
-
const ctx = this._ctx.select("getGitRepository", { name });
|
|
3266
|
-
return new GitRepository(ctx);
|
|
3267
|
-
};
|
|
3268
|
-
/**
|
|
3269
|
-
* Retrieve a variable in the llm environment, of type InputTypeDef
|
|
3270
|
-
* @param name The name of the variable
|
|
3271
|
-
*/
|
|
3272
|
-
getInputTypeDef = (name) => {
|
|
3273
|
-
const ctx = this._ctx.select("getInputTypeDef", { name });
|
|
3274
|
-
return new InputTypeDef(ctx);
|
|
3275
|
-
};
|
|
3276
|
-
/**
|
|
3277
|
-
* Retrieve a variable in the llm environment, of type InterfaceTypeDef
|
|
3278
|
-
* @param name The name of the variable
|
|
3279
|
-
*/
|
|
3280
|
-
getInterfaceTypeDef = (name) => {
|
|
3281
|
-
const ctx = this._ctx.select("getInterfaceTypeDef", { name });
|
|
3282
|
-
return new InterfaceTypeDef(ctx);
|
|
3283
|
-
};
|
|
3284
|
-
/**
|
|
3285
|
-
* Retrieve a variable in the llm environment, of type LLM
|
|
3286
|
-
* @param name The name of the variable
|
|
3287
|
-
*/
|
|
3288
|
-
getLLM = (name) => {
|
|
3289
|
-
const ctx = this._ctx.select("getLLM", { name });
|
|
3290
|
-
return new LLM(ctx);
|
|
3291
|
-
};
|
|
3292
|
-
/**
|
|
3293
|
-
* Retrieve a variable in the llm environment, of type ListTypeDef
|
|
3294
|
-
* @param name The name of the variable
|
|
3295
|
-
*/
|
|
3296
|
-
getListTypeDef = (name) => {
|
|
3297
|
-
const ctx = this._ctx.select("getListTypeDef", { name });
|
|
3298
|
-
return new ListTypeDef(ctx);
|
|
3299
|
-
};
|
|
3300
|
-
/**
|
|
3301
|
-
* Retrieve a variable in the llm environment, of type Module
|
|
3302
|
-
* @param name The name of the variable
|
|
3303
|
-
*/
|
|
3304
|
-
getModule = (name) => {
|
|
3305
|
-
const ctx = this._ctx.select("getModule", { name });
|
|
3306
|
-
return new Module_(ctx);
|
|
3307
|
-
};
|
|
3308
|
-
/**
|
|
3309
|
-
* Retrieve a variable in the llm environment, of type ModuleConfigClient
|
|
3310
|
-
* @param name The name of the variable
|
|
3311
|
-
*/
|
|
3312
|
-
getModuleConfigClient = (name) => {
|
|
3313
|
-
const ctx = this._ctx.select("getModuleConfigClient", { name });
|
|
3314
|
-
return new ModuleConfigClient(ctx);
|
|
3315
|
-
};
|
|
3316
|
-
/**
|
|
3317
|
-
* Retrieve a variable in the llm environment, of type ModuleSource
|
|
3318
|
-
* @param name The name of the variable
|
|
3319
|
-
*/
|
|
3320
|
-
getModuleSource = (name) => {
|
|
3321
|
-
const ctx = this._ctx.select("getModuleSource", { name });
|
|
3322
|
-
return new ModuleSource(ctx);
|
|
3323
|
-
};
|
|
3324
|
-
/**
|
|
3325
|
-
* Retrieve a variable in the llm environment, of type ObjectTypeDef
|
|
3326
|
-
* @param name The name of the variable
|
|
3327
|
-
*/
|
|
3328
|
-
getObjectTypeDef = (name) => {
|
|
3329
|
-
const ctx = this._ctx.select("getObjectTypeDef", { name });
|
|
3330
|
-
return new ObjectTypeDef(ctx);
|
|
3331
|
-
};
|
|
3332
|
-
/**
|
|
3333
|
-
* Retrieve a variable in the llm environment, of type SDKConfig
|
|
3334
|
-
* @param name The name of the variable
|
|
3335
|
-
*/
|
|
3336
|
-
getSDKConfig = (name) => {
|
|
3337
|
-
const ctx = this._ctx.select("getSDKConfig", { name });
|
|
3338
|
-
return new SDKConfig(ctx);
|
|
3339
|
-
};
|
|
3340
|
-
/**
|
|
3341
|
-
* Retrieve a variable in the llm environment, of type ScalarTypeDef
|
|
3342
|
-
* @param name The name of the variable
|
|
3343
|
-
*/
|
|
3344
|
-
getScalarTypeDef = (name) => {
|
|
3345
|
-
const ctx = this._ctx.select("getScalarTypeDef", { name });
|
|
3346
|
-
return new ScalarTypeDef(ctx);
|
|
3347
|
-
};
|
|
3348
|
-
/**
|
|
3349
|
-
* Retrieve a variable in the llm environment, of type Secret
|
|
3350
|
-
* @param name The name of the variable
|
|
3351
|
-
*/
|
|
3352
|
-
getSecret = (name) => {
|
|
3353
|
-
const ctx = this._ctx.select("getSecret", { name });
|
|
3354
|
-
return new Secret(ctx);
|
|
3355
|
-
};
|
|
3356
|
-
/**
|
|
3357
|
-
* Retrieve a variable in the llm environment, of type Service
|
|
3358
|
-
* @param name The name of the variable
|
|
3359
|
-
*/
|
|
3360
|
-
getService = (name) => {
|
|
3361
|
-
const ctx = this._ctx.select("getService", { name });
|
|
3362
|
-
return new Service(ctx);
|
|
3363
|
-
};
|
|
3364
|
-
/**
|
|
3365
|
-
* Retrieve a variable in the llm environment, of type Socket
|
|
3366
|
-
* @param name The name of the variable
|
|
3367
|
-
*/
|
|
3368
|
-
getSocket = (name) => {
|
|
3369
|
-
const ctx = this._ctx.select("getSocket", { name });
|
|
3370
|
-
return new Socket(ctx);
|
|
3371
|
-
};
|
|
3372
|
-
/**
|
|
3373
|
-
* Retrieve a variable in the llm environment, of type SourceMap
|
|
3374
|
-
* @param name The name of the variable
|
|
3375
|
-
*/
|
|
3376
|
-
getSourceMap = (name) => {
|
|
3377
|
-
const ctx = this._ctx.select("getSourceMap", { name });
|
|
3378
|
-
return new SourceMap(ctx);
|
|
3379
|
-
};
|
|
3380
|
-
/**
|
|
3381
|
-
* Get a string variable from the LLM's environment
|
|
3382
|
-
* @param name The variable name
|
|
3383
|
-
*/
|
|
3384
|
-
getString = async (name) => {
|
|
3385
|
-
if (this._getString) {
|
|
3386
|
-
return this._getString;
|
|
3387
|
-
}
|
|
3388
|
-
const ctx = this._ctx.select("getString", { name });
|
|
3389
|
-
const response = await ctx.execute();
|
|
3390
|
-
return response;
|
|
3391
|
-
};
|
|
3392
|
-
/**
|
|
3393
|
-
* Retrieve a variable in the llm environment, of type Terminal
|
|
3394
|
-
* @param name The name of the variable
|
|
3395
|
-
*/
|
|
3396
|
-
getTerminal = (name) => {
|
|
3397
|
-
const ctx = this._ctx.select("getTerminal", { name });
|
|
3398
|
-
return new Terminal(ctx);
|
|
3399
|
-
};
|
|
3400
|
-
/**
|
|
3401
|
-
* Retrieve a variable in the llm environment, of type TypeDef
|
|
3402
|
-
* @param name The name of the variable
|
|
3403
|
-
*/
|
|
3404
|
-
getTypeDef = (name) => {
|
|
3405
|
-
const ctx = this._ctx.select("getTypeDef", { name });
|
|
3406
|
-
return new TypeDef(ctx);
|
|
3407
|
-
};
|
|
3408
|
-
/**
|
|
3409
|
-
* Retrieve a the current value in the LLM environment, of type GitRef
|
|
3410
|
-
*/
|
|
3411
|
-
gitRef = () => {
|
|
3412
|
-
const ctx = this._ctx.select("gitRef");
|
|
3413
|
-
return new GitRef(ctx);
|
|
3414
|
-
};
|
|
3415
|
-
/**
|
|
3416
|
-
* Retrieve a the current value in the LLM environment, of type GitRepository
|
|
3417
|
-
*/
|
|
3418
|
-
gitRepository = () => {
|
|
3419
|
-
const ctx = this._ctx.select("gitRepository");
|
|
3420
|
-
return new GitRepository(ctx);
|
|
3421
|
-
};
|
|
3422
|
-
/**
|
|
3423
|
-
* return the llm message history
|
|
3424
|
-
*/
|
|
3425
|
-
history = async () => {
|
|
3426
|
-
const ctx = this._ctx.select("history");
|
|
3427
|
-
const response = await ctx.execute();
|
|
3428
|
-
return response;
|
|
3429
|
-
};
|
|
3430
|
-
/**
|
|
3431
|
-
* return the raw llm message history as json
|
|
3432
|
-
*/
|
|
3433
|
-
historyJSON = async () => {
|
|
3434
|
-
if (this._historyJSON) {
|
|
3435
|
-
return this._historyJSON;
|
|
3436
|
-
}
|
|
3437
|
-
const ctx = this._ctx.select("historyJSON");
|
|
3438
|
-
const response = await ctx.execute();
|
|
3439
|
-
return response;
|
|
3440
|
-
};
|
|
3441
|
-
/**
|
|
3442
|
-
* Retrieve a the current value in the LLM environment, of type InputTypeDef
|
|
3443
|
-
*/
|
|
3444
|
-
inputTypeDef = () => {
|
|
3445
|
-
const ctx = this._ctx.select("inputTypeDef");
|
|
3446
|
-
return new InputTypeDef(ctx);
|
|
3447
|
-
};
|
|
3448
|
-
/**
|
|
3449
|
-
* Retrieve a the current value in the LLM environment, of type InterfaceTypeDef
|
|
3450
|
-
*/
|
|
3451
|
-
interfaceTypeDef = () => {
|
|
3452
|
-
const ctx = this._ctx.select("interfaceTypeDef");
|
|
3453
|
-
return new InterfaceTypeDef(ctx);
|
|
3454
|
-
};
|
|
3455
|
-
/**
|
|
3456
|
-
* Retrieve a the current value in the LLM environment, of type LLM
|
|
3457
|
-
*/
|
|
3458
|
-
lLM = () => {
|
|
3459
|
-
const ctx = this._ctx.select("lLM");
|
|
3460
|
-
return new LLM(ctx);
|
|
3461
|
-
};
|
|
3462
|
-
/**
|
|
3463
|
-
* return the last llm reply from the history
|
|
3464
|
-
*/
|
|
3465
|
-
lastReply = async () => {
|
|
3466
|
-
if (this._lastReply) {
|
|
3467
|
-
return this._lastReply;
|
|
3468
|
-
}
|
|
3469
|
-
const ctx = this._ctx.select("lastReply");
|
|
3470
|
-
const response = await ctx.execute();
|
|
3471
|
-
return response;
|
|
3472
|
-
};
|
|
3473
|
-
/**
|
|
3474
|
-
* Retrieve a the current value in the LLM environment, of type ListTypeDef
|
|
3475
|
-
*/
|
|
3476
|
-
listTypeDef = () => {
|
|
3477
|
-
const ctx = this._ctx.select("listTypeDef");
|
|
3478
|
-
return new ListTypeDef(ctx);
|
|
3479
|
-
};
|
|
3480
|
-
/**
|
|
3481
|
-
* synchronize LLM state
|
|
3482
|
-
*/
|
|
3483
|
-
loop = () => {
|
|
3484
|
-
const ctx = this._ctx.select("loop");
|
|
3485
|
-
return new LLM(ctx);
|
|
3486
|
-
};
|
|
3487
|
-
/**
|
|
3488
|
-
* return the model used by the llm
|
|
3489
|
-
*/
|
|
3490
|
-
model = async () => {
|
|
3491
|
-
if (this._model) {
|
|
3492
|
-
return this._model;
|
|
3493
|
-
}
|
|
3494
|
-
const ctx = this._ctx.select("model");
|
|
3495
|
-
const response = await ctx.execute();
|
|
3496
|
-
return response;
|
|
3497
|
-
};
|
|
3498
|
-
/**
|
|
3499
|
-
* Retrieve a the current value in the LLM environment, of type Module
|
|
3500
|
-
*/
|
|
3501
|
-
module_ = () => {
|
|
3502
|
-
const ctx = this._ctx.select("module");
|
|
3503
|
-
return new Module_(ctx);
|
|
3504
|
-
};
|
|
3505
|
-
/**
|
|
3506
|
-
* Retrieve a the current value in the LLM environment, of type ModuleConfigClient
|
|
3507
|
-
*/
|
|
3508
|
-
moduleConfigClient = () => {
|
|
3509
|
-
const ctx = this._ctx.select("moduleConfigClient");
|
|
3510
|
-
return new ModuleConfigClient(ctx);
|
|
3511
|
-
};
|
|
3512
|
-
/**
|
|
3513
|
-
* Retrieve a the current value in the LLM environment, of type ModuleSource
|
|
3514
|
-
*/
|
|
3515
|
-
moduleSource = () => {
|
|
3516
|
-
const ctx = this._ctx.select("moduleSource");
|
|
3517
|
-
return new ModuleSource(ctx);
|
|
3518
|
-
};
|
|
3519
|
-
/**
|
|
3520
|
-
* Retrieve a the current value in the LLM environment, of type ObjectTypeDef
|
|
3521
|
-
*/
|
|
3522
|
-
objectTypeDef = () => {
|
|
3523
|
-
const ctx = this._ctx.select("objectTypeDef");
|
|
3524
|
-
return new ObjectTypeDef(ctx);
|
|
3525
|
-
};
|
|
3526
|
-
/**
|
|
3527
|
-
* return the provider used by the llm
|
|
3528
|
-
*/
|
|
3529
|
-
provider = async () => {
|
|
3530
|
-
if (this._provider) {
|
|
3531
|
-
return this._provider;
|
|
3532
|
-
}
|
|
3533
|
-
const ctx = this._ctx.select("provider");
|
|
3534
|
-
const response = await ctx.execute();
|
|
3535
|
-
return response;
|
|
3536
|
-
};
|
|
3537
|
-
/**
|
|
3538
|
-
* Retrieve a the current value in the LLM environment, of type ScalarTypeDef
|
|
3539
|
-
*/
|
|
3540
|
-
scalarTypeDef = () => {
|
|
3541
|
-
const ctx = this._ctx.select("scalarTypeDef");
|
|
3542
|
-
return new ScalarTypeDef(ctx);
|
|
3543
|
-
};
|
|
3544
|
-
/**
|
|
3545
|
-
* Retrieve a the current value in the LLM environment, of type SDKConfig
|
|
3546
|
-
*/
|
|
3547
|
-
sdkconfig = () => {
|
|
3548
|
-
const ctx = this._ctx.select("sdkconfig");
|
|
3549
|
-
return new SDKConfig(ctx);
|
|
3550
|
-
};
|
|
3551
|
-
/**
|
|
3552
|
-
* Retrieve a the current value in the LLM environment, of type Secret
|
|
3553
|
-
*/
|
|
3554
|
-
secret = () => {
|
|
3555
|
-
const ctx = this._ctx.select("secret");
|
|
3556
|
-
return new Secret(ctx);
|
|
3557
|
-
};
|
|
3558
|
-
/**
|
|
3559
|
-
* Retrieve a the current value in the LLM environment, of type Service
|
|
3560
|
-
*/
|
|
3561
|
-
service = () => {
|
|
3562
|
-
const ctx = this._ctx.select("service");
|
|
3563
|
-
return new Service(ctx);
|
|
3564
|
-
};
|
|
3565
|
-
/**
|
|
3566
|
-
* Set a variable of type CacheVolume in the llm environment
|
|
3567
|
-
* @param name The name of the variable
|
|
3568
|
-
* @param value The CacheVolume value to assign to the variable
|
|
3569
|
-
*/
|
|
3570
|
-
setCacheVolume = (name, value) => {
|
|
3571
|
-
const ctx = this._ctx.select("setCacheVolume", { name, value });
|
|
3572
|
-
return new LLM(ctx);
|
|
3573
|
-
};
|
|
3574
|
-
/**
|
|
3575
|
-
* Set a variable of type Container in the llm environment
|
|
3576
|
-
* @param name The name of the variable
|
|
3577
|
-
* @param value The Container value to assign to the variable
|
|
3578
|
-
*/
|
|
3579
|
-
setContainer = (name, value) => {
|
|
3580
|
-
const ctx = this._ctx.select("setContainer", { name, value });
|
|
3581
|
-
return new LLM(ctx);
|
|
3582
|
-
};
|
|
3583
|
-
/**
|
|
3584
|
-
* Set a variable of type CurrentModule in the llm environment
|
|
3585
|
-
* @param name The name of the variable
|
|
3586
|
-
* @param value The CurrentModule value to assign to the variable
|
|
3587
|
-
*/
|
|
3588
|
-
setCurrentModule = (name, value) => {
|
|
3589
|
-
const ctx = this._ctx.select("setCurrentModule", { name, value });
|
|
3590
|
-
return new LLM(ctx);
|
|
3591
|
-
};
|
|
3592
|
-
/**
|
|
3593
|
-
* Set a variable of type Directory in the llm environment
|
|
3594
|
-
* @param name The name of the variable
|
|
3595
|
-
* @param value The Directory value to assign to the variable
|
|
3596
|
-
*/
|
|
3597
|
-
setDirectory = (name, value) => {
|
|
3598
|
-
const ctx = this._ctx.select("setDirectory", { name, value });
|
|
3599
|
-
return new LLM(ctx);
|
|
3600
|
-
};
|
|
3601
|
-
/**
|
|
3602
|
-
* Set a variable of type EnumTypeDef in the llm environment
|
|
3603
|
-
* @param name The name of the variable
|
|
3604
|
-
* @param value The EnumTypeDef value to assign to the variable
|
|
3605
|
-
*/
|
|
3606
|
-
setEnumTypeDef = (name, value) => {
|
|
3607
|
-
const ctx = this._ctx.select("setEnumTypeDef", { name, value });
|
|
3608
|
-
return new LLM(ctx);
|
|
3609
|
-
};
|
|
3610
|
-
/**
|
|
3611
|
-
* Set a variable of type EnumValueTypeDef in the llm environment
|
|
3612
|
-
* @param name The name of the variable
|
|
3613
|
-
* @param value The EnumValueTypeDef value to assign to the variable
|
|
3614
|
-
*/
|
|
3615
|
-
setEnumValueTypeDef = (name, value) => {
|
|
3616
|
-
const ctx = this._ctx.select("setEnumValueTypeDef", { name, value });
|
|
3617
|
-
return new LLM(ctx);
|
|
3618
|
-
};
|
|
3619
|
-
/**
|
|
3620
|
-
* Set a variable of type Error in the llm environment
|
|
3621
|
-
* @param name The name of the variable
|
|
3622
|
-
* @param value The Error value to assign to the variable
|
|
3623
|
-
*/
|
|
3624
|
-
setError = (name, value) => {
|
|
3625
|
-
const ctx = this._ctx.select("setError", { name, value });
|
|
3626
|
-
return new LLM(ctx);
|
|
3627
|
-
};
|
|
3628
|
-
/**
|
|
3629
|
-
* Set a variable of type ErrorValue in the llm environment
|
|
3630
|
-
* @param name The name of the variable
|
|
3631
|
-
* @param value The ErrorValue value to assign to the variable
|
|
3632
|
-
*/
|
|
3633
|
-
setErrorValue = (name, value) => {
|
|
3634
|
-
const ctx = this._ctx.select("setErrorValue", { name, value });
|
|
3635
|
-
return new LLM(ctx);
|
|
3636
|
-
};
|
|
3637
|
-
/**
|
|
3638
|
-
* Set a variable of type FieldTypeDef in the llm environment
|
|
3639
|
-
* @param name The name of the variable
|
|
3640
|
-
* @param value The FieldTypeDef value to assign to the variable
|
|
3641
|
-
*/
|
|
3642
|
-
setFieldTypeDef = (name, value) => {
|
|
3643
|
-
const ctx = this._ctx.select("setFieldTypeDef", { name, value });
|
|
3644
|
-
return new LLM(ctx);
|
|
3645
|
-
};
|
|
3646
|
-
/**
|
|
3647
|
-
* Set a variable of type File in the llm environment
|
|
3648
|
-
* @param name The name of the variable
|
|
3649
|
-
* @param value The File value to assign to the variable
|
|
3650
|
-
*/
|
|
3651
|
-
setFile = (name, value) => {
|
|
3652
|
-
const ctx = this._ctx.select("setFile", { name, value });
|
|
3653
|
-
return new LLM(ctx);
|
|
3654
|
-
};
|
|
3655
|
-
/**
|
|
3656
|
-
* Set a variable of type Function in the llm environment
|
|
3657
|
-
* @param name The name of the variable
|
|
3658
|
-
* @param value The Function value to assign to the variable
|
|
3659
|
-
*/
|
|
3660
|
-
setFunction = (name, value) => {
|
|
3661
|
-
const ctx = this._ctx.select("setFunction", { name, value });
|
|
3662
|
-
return new LLM(ctx);
|
|
3663
|
-
};
|
|
3664
|
-
/**
|
|
3665
|
-
* Set a variable of type FunctionArg in the llm environment
|
|
3666
|
-
* @param name The name of the variable
|
|
3667
|
-
* @param value The FunctionArg value to assign to the variable
|
|
3668
|
-
*/
|
|
3669
|
-
setFunctionArg = (name, value) => {
|
|
3670
|
-
const ctx = this._ctx.select("setFunctionArg", { name, value });
|
|
3671
|
-
return new LLM(ctx);
|
|
3672
|
-
};
|
|
3673
|
-
/**
|
|
3674
|
-
* Set a variable of type FunctionCall in the llm environment
|
|
3675
|
-
* @param name The name of the variable
|
|
3676
|
-
* @param value The FunctionCall value to assign to the variable
|
|
3677
|
-
*/
|
|
3678
|
-
setFunctionCall = (name, value) => {
|
|
3679
|
-
const ctx = this._ctx.select("setFunctionCall", { name, value });
|
|
3680
|
-
return new LLM(ctx);
|
|
3681
|
-
};
|
|
3682
|
-
/**
|
|
3683
|
-
* Set a variable of type FunctionCallArgValue in the llm environment
|
|
3684
|
-
* @param name The name of the variable
|
|
3685
|
-
* @param value The FunctionCallArgValue value to assign to the variable
|
|
3686
|
-
*/
|
|
3687
|
-
setFunctionCallArgValue = (name, value) => {
|
|
3688
|
-
const ctx = this._ctx.select("setFunctionCallArgValue", { name, value });
|
|
3689
|
-
return new LLM(ctx);
|
|
3690
|
-
};
|
|
3691
|
-
/**
|
|
3692
|
-
* Set a variable of type GeneratedCode in the llm environment
|
|
3693
|
-
* @param name The name of the variable
|
|
3694
|
-
* @param value The GeneratedCode value to assign to the variable
|
|
3695
|
-
*/
|
|
3696
|
-
setGeneratedCode = (name, value) => {
|
|
3697
|
-
const ctx = this._ctx.select("setGeneratedCode", { name, value });
|
|
3698
|
-
return new LLM(ctx);
|
|
3699
|
-
};
|
|
3700
|
-
/**
|
|
3701
|
-
* Set a variable of type GitRef in the llm environment
|
|
3702
|
-
* @param name The name of the variable
|
|
3703
|
-
* @param value The GitRef value to assign to the variable
|
|
3704
|
-
*/
|
|
3705
|
-
setGitRef = (name, value) => {
|
|
3706
|
-
const ctx = this._ctx.select("setGitRef", { name, value });
|
|
3707
|
-
return new LLM(ctx);
|
|
3708
|
-
};
|
|
3709
|
-
/**
|
|
3710
|
-
* Set a variable of type GitRepository in the llm environment
|
|
3711
|
-
* @param name The name of the variable
|
|
3712
|
-
* @param value The GitRepository value to assign to the variable
|
|
3713
|
-
*/
|
|
3714
|
-
setGitRepository = (name, value) => {
|
|
3715
|
-
const ctx = this._ctx.select("setGitRepository", { name, value });
|
|
3716
|
-
return new LLM(ctx);
|
|
3717
|
-
};
|
|
3718
|
-
/**
|
|
3719
|
-
* Set a variable of type InputTypeDef in the llm environment
|
|
3720
|
-
* @param name The name of the variable
|
|
3721
|
-
* @param value The InputTypeDef value to assign to the variable
|
|
3722
|
-
*/
|
|
3723
|
-
setInputTypeDef = (name, value) => {
|
|
3724
|
-
const ctx = this._ctx.select("setInputTypeDef", { name, value });
|
|
3725
|
-
return new LLM(ctx);
|
|
3726
|
-
};
|
|
3727
|
-
/**
|
|
3728
|
-
* Set a variable of type InterfaceTypeDef in the llm environment
|
|
3729
|
-
* @param name The name of the variable
|
|
3730
|
-
* @param value The InterfaceTypeDef value to assign to the variable
|
|
3731
|
-
*/
|
|
3732
|
-
setInterfaceTypeDef = (name, value) => {
|
|
3733
|
-
const ctx = this._ctx.select("setInterfaceTypeDef", { name, value });
|
|
3734
|
-
return new LLM(ctx);
|
|
3735
|
-
};
|
|
3736
|
-
/**
|
|
3737
|
-
* Set a variable of type LLM in the llm environment
|
|
3738
|
-
* @param name The name of the variable
|
|
3739
|
-
* @param value The LLM value to assign to the variable
|
|
3740
|
-
*/
|
|
3741
|
-
setLLM = (name, value) => {
|
|
3742
|
-
const ctx = this._ctx.select("setLLM", { name, value });
|
|
3743
|
-
return new LLM(ctx);
|
|
3744
|
-
};
|
|
3745
|
-
/**
|
|
3746
|
-
* Set a variable of type ListTypeDef in the llm environment
|
|
3747
|
-
* @param name The name of the variable
|
|
3748
|
-
* @param value The ListTypeDef value to assign to the variable
|
|
3749
|
-
*/
|
|
3750
|
-
setListTypeDef = (name, value) => {
|
|
3751
|
-
const ctx = this._ctx.select("setListTypeDef", { name, value });
|
|
3752
|
-
return new LLM(ctx);
|
|
3753
|
-
};
|
|
3754
|
-
/**
|
|
3755
|
-
* Set a variable of type Module in the llm environment
|
|
3756
|
-
* @param name The name of the variable
|
|
3757
|
-
* @param value The Module value to assign to the variable
|
|
3758
|
-
*/
|
|
3759
|
-
setModule = (name, value) => {
|
|
3760
|
-
const ctx = this._ctx.select("setModule", { name, value });
|
|
3761
|
-
return new LLM(ctx);
|
|
3762
|
-
};
|
|
3763
|
-
/**
|
|
3764
|
-
* Set a variable of type ModuleConfigClient in the llm environment
|
|
3765
|
-
* @param name The name of the variable
|
|
3766
|
-
* @param value The ModuleConfigClient value to assign to the variable
|
|
3767
|
-
*/
|
|
3768
|
-
setModuleConfigClient = (name, value) => {
|
|
3769
|
-
const ctx = this._ctx.select("setModuleConfigClient", { name, value });
|
|
3770
|
-
return new LLM(ctx);
|
|
3771
|
-
};
|
|
3772
|
-
/**
|
|
3773
|
-
* Set a variable of type ModuleSource in the llm environment
|
|
3774
|
-
* @param name The name of the variable
|
|
3775
|
-
* @param value The ModuleSource value to assign to the variable
|
|
3776
|
-
*/
|
|
3777
|
-
setModuleSource = (name, value) => {
|
|
3778
|
-
const ctx = this._ctx.select("setModuleSource", { name, value });
|
|
3779
|
-
return new LLM(ctx);
|
|
3780
|
-
};
|
|
3781
|
-
/**
|
|
3782
|
-
* Set a variable of type ObjectTypeDef in the llm environment
|
|
3783
|
-
* @param name The name of the variable
|
|
3784
|
-
* @param value The ObjectTypeDef value to assign to the variable
|
|
3785
|
-
*/
|
|
3786
|
-
setObjectTypeDef = (name, value) => {
|
|
3787
|
-
const ctx = this._ctx.select("setObjectTypeDef", { name, value });
|
|
3788
|
-
return new LLM(ctx);
|
|
3789
|
-
};
|
|
3790
|
-
/**
|
|
3791
|
-
* Set a variable of type SDKConfig in the llm environment
|
|
3792
|
-
* @param name The name of the variable
|
|
3793
|
-
* @param value The SDKConfig value to assign to the variable
|
|
3794
|
-
*/
|
|
3795
|
-
setSDKConfig = (name, value) => {
|
|
3796
|
-
const ctx = this._ctx.select("setSDKConfig", { name, value });
|
|
3797
|
-
return new LLM(ctx);
|
|
3798
|
-
};
|
|
3799
|
-
/**
|
|
3800
|
-
* Set a variable of type ScalarTypeDef in the llm environment
|
|
3801
|
-
* @param name The name of the variable
|
|
3802
|
-
* @param value The ScalarTypeDef value to assign to the variable
|
|
3803
|
-
*/
|
|
3804
|
-
setScalarTypeDef = (name, value) => {
|
|
3805
|
-
const ctx = this._ctx.select("setScalarTypeDef", { name, value });
|
|
3806
|
-
return new LLM(ctx);
|
|
3807
|
-
};
|
|
3808
|
-
/**
|
|
3809
|
-
* Set a variable of type Secret in the llm environment
|
|
3810
|
-
* @param name The name of the variable
|
|
3811
|
-
* @param value The Secret value to assign to the variable
|
|
3812
|
-
*/
|
|
3813
|
-
setSecret = (name, value) => {
|
|
3814
|
-
const ctx = this._ctx.select("setSecret", { name, value });
|
|
3815
|
-
return new LLM(ctx);
|
|
3816
|
-
};
|
|
3817
|
-
/**
|
|
3818
|
-
* Set a variable of type Service in the llm environment
|
|
3819
|
-
* @param name The name of the variable
|
|
3820
|
-
* @param value The Service value to assign to the variable
|
|
3821
|
-
*/
|
|
3822
|
-
setService = (name, value) => {
|
|
3823
|
-
const ctx = this._ctx.select("setService", { name, value });
|
|
3824
|
-
return new LLM(ctx);
|
|
3825
|
-
};
|
|
3826
|
-
/**
|
|
3827
|
-
* Set a variable of type Socket in the llm environment
|
|
3828
|
-
* @param name The name of the variable
|
|
3829
|
-
* @param value The Socket value to assign to the variable
|
|
3830
|
-
*/
|
|
3831
|
-
setSocket = (name, value) => {
|
|
3832
|
-
const ctx = this._ctx.select("setSocket", { name, value });
|
|
3833
|
-
return new LLM(ctx);
|
|
3834
|
-
};
|
|
3835
|
-
/**
|
|
3836
|
-
* Set a variable of type SourceMap in the llm environment
|
|
3837
|
-
* @param name The name of the variable
|
|
3838
|
-
* @param value The SourceMap value to assign to the variable
|
|
3839
|
-
*/
|
|
3840
|
-
setSourceMap = (name, value) => {
|
|
3841
|
-
const ctx = this._ctx.select("setSourceMap", { name, value });
|
|
3842
|
-
return new LLM(ctx);
|
|
3843
|
-
};
|
|
3844
|
-
/**
|
|
3845
|
-
* Add a string variable to the LLM's environment
|
|
3846
|
-
* @param name The variable name
|
|
3847
|
-
* @param value The variable value
|
|
3848
|
-
*/
|
|
3849
|
-
setString = (name, value) => {
|
|
3850
|
-
const ctx = this._ctx.select("setString", { name, value });
|
|
3851
|
-
return new LLM(ctx);
|
|
3852
|
-
};
|
|
3853
|
-
/**
|
|
3854
|
-
* Set a variable of type Terminal in the llm environment
|
|
3855
|
-
* @param name The name of the variable
|
|
3856
|
-
* @param value The Terminal value to assign to the variable
|
|
3857
|
-
*/
|
|
3858
|
-
setTerminal = (name, value) => {
|
|
3859
|
-
const ctx = this._ctx.select("setTerminal", { name, value });
|
|
3860
|
-
return new LLM(ctx);
|
|
3861
|
-
};
|
|
3862
|
-
/**
|
|
3863
|
-
* Set a variable of type TypeDef in the llm environment
|
|
3864
|
-
* @param name The name of the variable
|
|
3865
|
-
* @param value The TypeDef value to assign to the variable
|
|
3866
|
-
*/
|
|
3867
|
-
setTypeDef = (name, value) => {
|
|
3868
|
-
const ctx = this._ctx.select("setTypeDef", { name, value });
|
|
3869
|
-
return new LLM(ctx);
|
|
3870
|
-
};
|
|
3871
|
-
/**
|
|
3872
|
-
* Retrieve a the current value in the LLM environment, of type Socket
|
|
3873
|
-
*/
|
|
3874
|
-
socket = () => {
|
|
3875
|
-
const ctx = this._ctx.select("socket");
|
|
3876
|
-
return new Socket(ctx);
|
|
3877
|
-
};
|
|
3878
|
-
/**
|
|
3879
|
-
* Retrieve a the current value in the LLM environment, of type SourceMap
|
|
3880
|
-
*/
|
|
3881
|
-
sourceMap = () => {
|
|
3882
|
-
const ctx = this._ctx.select("sourceMap");
|
|
3883
|
-
return new SourceMap(ctx);
|
|
3884
|
-
};
|
|
3885
|
-
/**
|
|
3886
|
-
* synchronize LLM state
|
|
3887
|
-
*/
|
|
3888
|
-
sync = async () => {
|
|
3889
|
-
const ctx = this._ctx.select("sync");
|
|
3890
|
-
const response = await ctx.execute();
|
|
3891
|
-
return new Client(ctx.copy()).loadLLMFromID(response);
|
|
3438
|
+
return response;
|
|
3892
3439
|
};
|
|
3893
3440
|
/**
|
|
3894
|
-
*
|
|
3441
|
+
* Static fields defined on this input object, if any.
|
|
3895
3442
|
*/
|
|
3896
|
-
|
|
3897
|
-
const ctx = this._ctx.select("
|
|
3898
|
-
|
|
3443
|
+
fields = async () => {
|
|
3444
|
+
const ctx = this._ctx.select("fields").select("id");
|
|
3445
|
+
const response = await ctx.execute();
|
|
3446
|
+
return response.map((r) => new Client(ctx.copy()).loadFieldTypeDefFromID(r.id));
|
|
3899
3447
|
};
|
|
3900
3448
|
/**
|
|
3901
|
-
*
|
|
3449
|
+
* The name of the input object.
|
|
3902
3450
|
*/
|
|
3903
|
-
|
|
3904
|
-
if (this.
|
|
3905
|
-
return this.
|
|
3451
|
+
name = async () => {
|
|
3452
|
+
if (this._name) {
|
|
3453
|
+
return this._name;
|
|
3906
3454
|
}
|
|
3907
|
-
const ctx = this._ctx.select("
|
|
3455
|
+
const ctx = this._ctx.select("name");
|
|
3908
3456
|
const response = await ctx.execute();
|
|
3909
3457
|
return response;
|
|
3910
3458
|
};
|
|
3459
|
+
}
|
|
3460
|
+
/**
|
|
3461
|
+
* A definition of a custom interface defined in a Module.
|
|
3462
|
+
*/
|
|
3463
|
+
export class InterfaceTypeDef extends BaseClient {
|
|
3464
|
+
_id = undefined;
|
|
3465
|
+
_description = undefined;
|
|
3466
|
+
_name = undefined;
|
|
3467
|
+
_sourceModuleName = undefined;
|
|
3911
3468
|
/**
|
|
3912
|
-
*
|
|
3469
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3913
3470
|
*/
|
|
3914
|
-
|
|
3915
|
-
|
|
3916
|
-
|
|
3917
|
-
|
|
3471
|
+
constructor(ctx, _id, _description, _name, _sourceModuleName) {
|
|
3472
|
+
super(ctx);
|
|
3473
|
+
this._id = _id;
|
|
3474
|
+
this._description = _description;
|
|
3475
|
+
this._name = _name;
|
|
3476
|
+
this._sourceModuleName = _sourceModuleName;
|
|
3477
|
+
}
|
|
3918
3478
|
/**
|
|
3919
|
-
*
|
|
3479
|
+
* A unique identifier for this InterfaceTypeDef.
|
|
3920
3480
|
*/
|
|
3921
|
-
|
|
3922
|
-
|
|
3481
|
+
id = async () => {
|
|
3482
|
+
if (this._id) {
|
|
3483
|
+
return this._id;
|
|
3484
|
+
}
|
|
3485
|
+
const ctx = this._ctx.select("id");
|
|
3923
3486
|
const response = await ctx.execute();
|
|
3924
|
-
return response
|
|
3925
|
-
};
|
|
3926
|
-
/**
|
|
3927
|
-
* Set a variable of type CacheVolume in the llm environment
|
|
3928
|
-
* @param value The CacheVolume value to assign to the variable
|
|
3929
|
-
*/
|
|
3930
|
-
withCacheVolume = (value) => {
|
|
3931
|
-
const ctx = this._ctx.select("withCacheVolume", { value });
|
|
3932
|
-
return new LLM(ctx);
|
|
3487
|
+
return response;
|
|
3933
3488
|
};
|
|
3934
3489
|
/**
|
|
3935
|
-
*
|
|
3936
|
-
* @param value The Container value to assign to the variable
|
|
3490
|
+
* The doc string for the interface, if any.
|
|
3937
3491
|
*/
|
|
3938
|
-
|
|
3939
|
-
|
|
3940
|
-
|
|
3492
|
+
description = async () => {
|
|
3493
|
+
if (this._description) {
|
|
3494
|
+
return this._description;
|
|
3495
|
+
}
|
|
3496
|
+
const ctx = this._ctx.select("description");
|
|
3497
|
+
const response = await ctx.execute();
|
|
3498
|
+
return response;
|
|
3941
3499
|
};
|
|
3942
3500
|
/**
|
|
3943
|
-
*
|
|
3944
|
-
* @param value The CurrentModule value to assign to the variable
|
|
3501
|
+
* Functions defined on this interface, if any.
|
|
3945
3502
|
*/
|
|
3946
|
-
|
|
3947
|
-
const ctx = this._ctx.select("
|
|
3948
|
-
|
|
3503
|
+
functions = async () => {
|
|
3504
|
+
const ctx = this._ctx.select("functions").select("id");
|
|
3505
|
+
const response = await ctx.execute();
|
|
3506
|
+
return response.map((r) => new Client(ctx.copy()).loadFunctionFromID(r.id));
|
|
3949
3507
|
};
|
|
3950
3508
|
/**
|
|
3951
|
-
*
|
|
3952
|
-
* @param value The Directory value to assign to the variable
|
|
3509
|
+
* The name of the interface.
|
|
3953
3510
|
*/
|
|
3954
|
-
|
|
3955
|
-
|
|
3956
|
-
|
|
3511
|
+
name = async () => {
|
|
3512
|
+
if (this._name) {
|
|
3513
|
+
return this._name;
|
|
3514
|
+
}
|
|
3515
|
+
const ctx = this._ctx.select("name");
|
|
3516
|
+
const response = await ctx.execute();
|
|
3517
|
+
return response;
|
|
3957
3518
|
};
|
|
3958
3519
|
/**
|
|
3959
|
-
*
|
|
3960
|
-
* @param value The EnumTypeDef value to assign to the variable
|
|
3520
|
+
* The location of this interface declaration.
|
|
3961
3521
|
*/
|
|
3962
|
-
|
|
3963
|
-
const ctx = this._ctx.select("
|
|
3964
|
-
return new
|
|
3522
|
+
sourceMap = () => {
|
|
3523
|
+
const ctx = this._ctx.select("sourceMap");
|
|
3524
|
+
return new SourceMap(ctx);
|
|
3965
3525
|
};
|
|
3966
3526
|
/**
|
|
3967
|
-
*
|
|
3968
|
-
* @param value The EnumValueTypeDef value to assign to the variable
|
|
3527
|
+
* If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
3969
3528
|
*/
|
|
3970
|
-
|
|
3971
|
-
|
|
3972
|
-
|
|
3529
|
+
sourceModuleName = async () => {
|
|
3530
|
+
if (this._sourceModuleName) {
|
|
3531
|
+
return this._sourceModuleName;
|
|
3532
|
+
}
|
|
3533
|
+
const ctx = this._ctx.select("sourceModuleName");
|
|
3534
|
+
const response = await ctx.execute();
|
|
3535
|
+
return response;
|
|
3973
3536
|
};
|
|
3537
|
+
}
|
|
3538
|
+
export class LLM extends BaseClient {
|
|
3539
|
+
_id = undefined;
|
|
3540
|
+
_historyJSON = undefined;
|
|
3541
|
+
_lastReply = undefined;
|
|
3542
|
+
_model = undefined;
|
|
3543
|
+
_provider = undefined;
|
|
3544
|
+
_sync = undefined;
|
|
3545
|
+
_tools = undefined;
|
|
3974
3546
|
/**
|
|
3975
|
-
*
|
|
3976
|
-
* @param value The Error value to assign to the variable
|
|
3547
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
3977
3548
|
*/
|
|
3978
|
-
|
|
3979
|
-
|
|
3980
|
-
|
|
3981
|
-
|
|
3549
|
+
constructor(ctx, _id, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
|
|
3550
|
+
super(ctx);
|
|
3551
|
+
this._id = _id;
|
|
3552
|
+
this._historyJSON = _historyJSON;
|
|
3553
|
+
this._lastReply = _lastReply;
|
|
3554
|
+
this._model = _model;
|
|
3555
|
+
this._provider = _provider;
|
|
3556
|
+
this._sync = _sync;
|
|
3557
|
+
this._tools = _tools;
|
|
3558
|
+
}
|
|
3982
3559
|
/**
|
|
3983
|
-
*
|
|
3984
|
-
* @param value The ErrorValue value to assign to the variable
|
|
3560
|
+
* A unique identifier for this LLM.
|
|
3985
3561
|
*/
|
|
3986
|
-
|
|
3987
|
-
|
|
3988
|
-
|
|
3562
|
+
id = async () => {
|
|
3563
|
+
if (this._id) {
|
|
3564
|
+
return this._id;
|
|
3565
|
+
}
|
|
3566
|
+
const ctx = this._ctx.select("id");
|
|
3567
|
+
const response = await ctx.execute();
|
|
3568
|
+
return response;
|
|
3989
3569
|
};
|
|
3990
3570
|
/**
|
|
3991
|
-
*
|
|
3992
|
-
* @param value The FieldTypeDef value to assign to the variable
|
|
3571
|
+
* create a branch in the LLM's history
|
|
3993
3572
|
*/
|
|
3994
|
-
|
|
3995
|
-
const ctx = this._ctx.select("
|
|
3573
|
+
attempt = (number_) => {
|
|
3574
|
+
const ctx = this._ctx.select("attempt", {
|
|
3575
|
+
number: number_,
|
|
3576
|
+
});
|
|
3996
3577
|
return new LLM(ctx);
|
|
3997
3578
|
};
|
|
3998
3579
|
/**
|
|
3999
|
-
*
|
|
4000
|
-
* @param value The File value to assign to the variable
|
|
3580
|
+
* returns the type of the current state
|
|
4001
3581
|
*/
|
|
4002
|
-
|
|
4003
|
-
const ctx = this._ctx.select("
|
|
4004
|
-
return new
|
|
3582
|
+
bindResult = (name) => {
|
|
3583
|
+
const ctx = this._ctx.select("bindResult", { name });
|
|
3584
|
+
return new Binding(ctx);
|
|
4005
3585
|
};
|
|
4006
3586
|
/**
|
|
4007
|
-
*
|
|
4008
|
-
* @param value The Function value to assign to the variable
|
|
3587
|
+
* return the LLM's current environment
|
|
4009
3588
|
*/
|
|
4010
|
-
|
|
4011
|
-
const ctx = this._ctx.select("
|
|
4012
|
-
return new
|
|
3589
|
+
env = () => {
|
|
3590
|
+
const ctx = this._ctx.select("env");
|
|
3591
|
+
return new Env(ctx);
|
|
4013
3592
|
};
|
|
4014
3593
|
/**
|
|
4015
|
-
*
|
|
4016
|
-
* @param value The FunctionArg value to assign to the variable
|
|
3594
|
+
* return the llm message history
|
|
4017
3595
|
*/
|
|
4018
|
-
|
|
4019
|
-
const ctx = this._ctx.select("
|
|
4020
|
-
|
|
3596
|
+
history = async () => {
|
|
3597
|
+
const ctx = this._ctx.select("history");
|
|
3598
|
+
const response = await ctx.execute();
|
|
3599
|
+
return response;
|
|
4021
3600
|
};
|
|
4022
3601
|
/**
|
|
4023
|
-
*
|
|
4024
|
-
* @param value The FunctionCall value to assign to the variable
|
|
3602
|
+
* return the raw llm message history as json
|
|
4025
3603
|
*/
|
|
4026
|
-
|
|
4027
|
-
|
|
4028
|
-
|
|
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;
|
|
4029
3611
|
};
|
|
4030
3612
|
/**
|
|
4031
|
-
*
|
|
4032
|
-
* @param value The FunctionCallArgValue value to assign to the variable
|
|
3613
|
+
* return the last llm reply from the history
|
|
4033
3614
|
*/
|
|
4034
|
-
|
|
4035
|
-
|
|
4036
|
-
|
|
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;
|
|
4037
3622
|
};
|
|
4038
3623
|
/**
|
|
4039
|
-
*
|
|
4040
|
-
* @param value The GeneratedCode value to assign to the variable
|
|
3624
|
+
* synchronize LLM state
|
|
4041
3625
|
*/
|
|
4042
|
-
|
|
4043
|
-
const ctx = this._ctx.select("
|
|
3626
|
+
loop = () => {
|
|
3627
|
+
const ctx = this._ctx.select("loop");
|
|
4044
3628
|
return new LLM(ctx);
|
|
4045
3629
|
};
|
|
4046
3630
|
/**
|
|
4047
|
-
*
|
|
4048
|
-
* @param value The GitRef value to assign to the variable
|
|
3631
|
+
* return the model used by the llm
|
|
4049
3632
|
*/
|
|
4050
|
-
|
|
4051
|
-
|
|
4052
|
-
|
|
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;
|
|
4053
3640
|
};
|
|
4054
3641
|
/**
|
|
4055
|
-
*
|
|
4056
|
-
* @param value The GitRepository value to assign to the variable
|
|
3642
|
+
* return the provider used by the llm
|
|
4057
3643
|
*/
|
|
4058
|
-
|
|
4059
|
-
|
|
4060
|
-
|
|
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;
|
|
4061
3651
|
};
|
|
4062
3652
|
/**
|
|
4063
|
-
*
|
|
4064
|
-
* @param value The InputTypeDef value to assign to the variable
|
|
3653
|
+
* synchronize LLM state
|
|
4065
3654
|
*/
|
|
4066
|
-
|
|
4067
|
-
const ctx = this._ctx.select("
|
|
4068
|
-
|
|
3655
|
+
sync = async () => {
|
|
3656
|
+
const ctx = this._ctx.select("sync");
|
|
3657
|
+
const response = await ctx.execute();
|
|
3658
|
+
return new Client(ctx.copy()).loadLLMFromID(response);
|
|
4069
3659
|
};
|
|
4070
3660
|
/**
|
|
4071
|
-
*
|
|
4072
|
-
* @param value The InterfaceTypeDef value to assign to the variable
|
|
3661
|
+
* returns the token usage of the current state
|
|
4073
3662
|
*/
|
|
4074
|
-
|
|
4075
|
-
const ctx = this._ctx.select("
|
|
4076
|
-
return new
|
|
3663
|
+
tokenUsage = () => {
|
|
3664
|
+
const ctx = this._ctx.select("tokenUsage");
|
|
3665
|
+
return new LLMTokenUsage(ctx);
|
|
4077
3666
|
};
|
|
4078
3667
|
/**
|
|
4079
|
-
*
|
|
4080
|
-
* @param value The LLM value to assign to the variable
|
|
3668
|
+
* print documentation for available tools
|
|
4081
3669
|
*/
|
|
4082
|
-
|
|
4083
|
-
|
|
4084
|
-
|
|
3670
|
+
tools = async () => {
|
|
3671
|
+
if (this._tools) {
|
|
3672
|
+
return this._tools;
|
|
3673
|
+
}
|
|
3674
|
+
const ctx = this._ctx.select("tools");
|
|
3675
|
+
const response = await ctx.execute();
|
|
3676
|
+
return response;
|
|
4085
3677
|
};
|
|
4086
3678
|
/**
|
|
4087
|
-
*
|
|
4088
|
-
* @param value The ListTypeDef value to assign to the variable
|
|
3679
|
+
* allow the LLM to interact with an environment via MCP
|
|
4089
3680
|
*/
|
|
4090
|
-
|
|
4091
|
-
const ctx = this._ctx.select("
|
|
3681
|
+
withEnv = (env) => {
|
|
3682
|
+
const ctx = this._ctx.select("withEnv", { env });
|
|
4092
3683
|
return new LLM(ctx);
|
|
4093
3684
|
};
|
|
4094
3685
|
/**
|
|
@@ -4099,38 +3690,6 @@ export class LLM extends BaseClient {
|
|
|
4099
3690
|
const ctx = this._ctx.select("withModel", { model });
|
|
4100
3691
|
return new LLM(ctx);
|
|
4101
3692
|
};
|
|
4102
|
-
/**
|
|
4103
|
-
* Set a variable of type Module in the llm environment
|
|
4104
|
-
* @param value The Module value to assign to the variable
|
|
4105
|
-
*/
|
|
4106
|
-
withModule = (value) => {
|
|
4107
|
-
const ctx = this._ctx.select("withModule", { value });
|
|
4108
|
-
return new LLM(ctx);
|
|
4109
|
-
};
|
|
4110
|
-
/**
|
|
4111
|
-
* Set a variable of type ModuleConfigClient in the llm environment
|
|
4112
|
-
* @param value The ModuleConfigClient value to assign to the variable
|
|
4113
|
-
*/
|
|
4114
|
-
withModuleConfigClient = (value) => {
|
|
4115
|
-
const ctx = this._ctx.select("withModuleConfigClient", { value });
|
|
4116
|
-
return new LLM(ctx);
|
|
4117
|
-
};
|
|
4118
|
-
/**
|
|
4119
|
-
* Set a variable of type ModuleSource in the llm environment
|
|
4120
|
-
* @param value The ModuleSource value to assign to the variable
|
|
4121
|
-
*/
|
|
4122
|
-
withModuleSource = (value) => {
|
|
4123
|
-
const ctx = this._ctx.select("withModuleSource", { value });
|
|
4124
|
-
return new LLM(ctx);
|
|
4125
|
-
};
|
|
4126
|
-
/**
|
|
4127
|
-
* Set a variable of type ObjectTypeDef in the llm environment
|
|
4128
|
-
* @param value The ObjectTypeDef value to assign to the variable
|
|
4129
|
-
*/
|
|
4130
|
-
withObjectTypeDef = (value) => {
|
|
4131
|
-
const ctx = this._ctx.select("withObjectTypeDef", { value });
|
|
4132
|
-
return new LLM(ctx);
|
|
4133
|
-
};
|
|
4134
3693
|
/**
|
|
4135
3694
|
* append a prompt to the llm context
|
|
4136
3695
|
* @param prompt The prompt to send
|
|
@@ -4147,15 +3706,6 @@ export class LLM extends BaseClient {
|
|
|
4147
3706
|
const ctx = this._ctx.select("withPromptFile", { file });
|
|
4148
3707
|
return new LLM(ctx);
|
|
4149
3708
|
};
|
|
4150
|
-
/**
|
|
4151
|
-
* Add a string variable to the LLM's environment
|
|
4152
|
-
* @param name The variable name
|
|
4153
|
-
* @param value The variable value
|
|
4154
|
-
*/
|
|
4155
|
-
withPromptVar = (name, value) => {
|
|
4156
|
-
const ctx = this._ctx.select("withPromptVar", { name, value });
|
|
4157
|
-
return new LLM(ctx);
|
|
4158
|
-
};
|
|
4159
3709
|
/**
|
|
4160
3710
|
* Provide the entire Query object to the LLM
|
|
4161
3711
|
*/
|
|
@@ -4164,67 +3714,11 @@ export class LLM extends BaseClient {
|
|
|
4164
3714
|
return new LLM(ctx);
|
|
4165
3715
|
};
|
|
4166
3716
|
/**
|
|
4167
|
-
*
|
|
4168
|
-
* @param
|
|
4169
|
-
*/
|
|
4170
|
-
withSDKConfig = (value) => {
|
|
4171
|
-
const ctx = this._ctx.select("withSDKConfig", { value });
|
|
4172
|
-
return new LLM(ctx);
|
|
4173
|
-
};
|
|
4174
|
-
/**
|
|
4175
|
-
* Set a variable of type ScalarTypeDef in the llm environment
|
|
4176
|
-
* @param value The ScalarTypeDef value to assign to the variable
|
|
4177
|
-
*/
|
|
4178
|
-
withScalarTypeDef = (value) => {
|
|
4179
|
-
const ctx = this._ctx.select("withScalarTypeDef", { value });
|
|
4180
|
-
return new LLM(ctx);
|
|
4181
|
-
};
|
|
4182
|
-
/**
|
|
4183
|
-
* Set a variable of type Secret in the llm environment
|
|
4184
|
-
* @param value The Secret value to assign to the variable
|
|
4185
|
-
*/
|
|
4186
|
-
withSecret = (value) => {
|
|
4187
|
-
const ctx = this._ctx.select("withSecret", { value });
|
|
4188
|
-
return new LLM(ctx);
|
|
4189
|
-
};
|
|
4190
|
-
/**
|
|
4191
|
-
* Set a variable of type Service in the llm environment
|
|
4192
|
-
* @param value The Service value to assign to the variable
|
|
4193
|
-
*/
|
|
4194
|
-
withService = (value) => {
|
|
4195
|
-
const ctx = this._ctx.select("withService", { value });
|
|
4196
|
-
return new LLM(ctx);
|
|
4197
|
-
};
|
|
4198
|
-
/**
|
|
4199
|
-
* Set a variable of type Socket in the llm environment
|
|
4200
|
-
* @param value The Socket value to assign to the variable
|
|
4201
|
-
*/
|
|
4202
|
-
withSocket = (value) => {
|
|
4203
|
-
const ctx = this._ctx.select("withSocket", { value });
|
|
4204
|
-
return new LLM(ctx);
|
|
4205
|
-
};
|
|
4206
|
-
/**
|
|
4207
|
-
* Set a variable of type SourceMap in the llm environment
|
|
4208
|
-
* @param value The SourceMap value to assign to the variable
|
|
4209
|
-
*/
|
|
4210
|
-
withSourceMap = (value) => {
|
|
4211
|
-
const ctx = this._ctx.select("withSourceMap", { value });
|
|
4212
|
-
return new LLM(ctx);
|
|
4213
|
-
};
|
|
4214
|
-
/**
|
|
4215
|
-
* Set a variable of type Terminal in the llm environment
|
|
4216
|
-
* @param value The Terminal value to assign to the variable
|
|
4217
|
-
*/
|
|
4218
|
-
withTerminal = (value) => {
|
|
4219
|
-
const ctx = this._ctx.select("withTerminal", { value });
|
|
4220
|
-
return new LLM(ctx);
|
|
4221
|
-
};
|
|
4222
|
-
/**
|
|
4223
|
-
* Set a variable of type TypeDef in the llm environment
|
|
4224
|
-
* @param value The TypeDef value to assign to the variable
|
|
3717
|
+
* Add a system prompt to the LLM's environment
|
|
3718
|
+
* @param prompt The system prompt to send
|
|
4225
3719
|
*/
|
|
4226
|
-
|
|
4227
|
-
const ctx = this._ctx.select("
|
|
3720
|
+
withSystemPrompt = (prompt) => {
|
|
3721
|
+
const ctx = this._ctx.select("withSystemPrompt", { prompt });
|
|
4228
3722
|
return new LLM(ctx);
|
|
4229
3723
|
};
|
|
4230
3724
|
/**
|
|
@@ -4236,23 +3730,23 @@ export class LLM extends BaseClient {
|
|
|
4236
3730
|
return arg(this);
|
|
4237
3731
|
};
|
|
4238
3732
|
}
|
|
4239
|
-
export class
|
|
3733
|
+
export class LLMTokenUsage extends BaseClient {
|
|
4240
3734
|
_id = undefined;
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
|
|
3735
|
+
_inputTokens = undefined;
|
|
3736
|
+
_outputTokens = undefined;
|
|
3737
|
+
_totalTokens = undefined;
|
|
4244
3738
|
/**
|
|
4245
3739
|
* Constructor is used for internal usage only, do not create object from it.
|
|
4246
3740
|
*/
|
|
4247
|
-
constructor(ctx, _id,
|
|
3741
|
+
constructor(ctx, _id, _inputTokens, _outputTokens, _totalTokens) {
|
|
4248
3742
|
super(ctx);
|
|
4249
3743
|
this._id = _id;
|
|
4250
|
-
this.
|
|
4251
|
-
this.
|
|
4252
|
-
this.
|
|
3744
|
+
this._inputTokens = _inputTokens;
|
|
3745
|
+
this._outputTokens = _outputTokens;
|
|
3746
|
+
this._totalTokens = _totalTokens;
|
|
4253
3747
|
}
|
|
4254
3748
|
/**
|
|
4255
|
-
* A unique identifier for this
|
|
3749
|
+
* A unique identifier for this LLMTokenUsage.
|
|
4256
3750
|
*/
|
|
4257
3751
|
id = async () => {
|
|
4258
3752
|
if (this._id) {
|
|
@@ -4262,27 +3756,27 @@ export class LLMVariable extends BaseClient {
|
|
|
4262
3756
|
const response = await ctx.execute();
|
|
4263
3757
|
return response;
|
|
4264
3758
|
};
|
|
4265
|
-
|
|
4266
|
-
if (this.
|
|
4267
|
-
return this.
|
|
3759
|
+
inputTokens = async () => {
|
|
3760
|
+
if (this._inputTokens) {
|
|
3761
|
+
return this._inputTokens;
|
|
4268
3762
|
}
|
|
4269
|
-
const ctx = this._ctx.select("
|
|
3763
|
+
const ctx = this._ctx.select("inputTokens");
|
|
4270
3764
|
const response = await ctx.execute();
|
|
4271
3765
|
return response;
|
|
4272
3766
|
};
|
|
4273
|
-
|
|
4274
|
-
if (this.
|
|
4275
|
-
return this.
|
|
3767
|
+
outputTokens = async () => {
|
|
3768
|
+
if (this._outputTokens) {
|
|
3769
|
+
return this._outputTokens;
|
|
4276
3770
|
}
|
|
4277
|
-
const ctx = this._ctx.select("
|
|
3771
|
+
const ctx = this._ctx.select("outputTokens");
|
|
4278
3772
|
const response = await ctx.execute();
|
|
4279
3773
|
return response;
|
|
4280
3774
|
};
|
|
4281
|
-
|
|
4282
|
-
if (this.
|
|
4283
|
-
return this.
|
|
3775
|
+
totalTokens = async () => {
|
|
3776
|
+
if (this._totalTokens) {
|
|
3777
|
+
return this._totalTokens;
|
|
4284
3778
|
}
|
|
4285
|
-
const ctx = this._ctx.select("
|
|
3779
|
+
const ctx = this._ctx.select("totalTokens");
|
|
4286
3780
|
const response = await ctx.execute();
|
|
4287
3781
|
return response;
|
|
4288
3782
|
};
|
|
@@ -5199,14 +4693,6 @@ export class Client extends BaseClient {
|
|
|
5199
4693
|
getGQLClient() {
|
|
5200
4694
|
return this._ctx.getGQLClient();
|
|
5201
4695
|
}
|
|
5202
|
-
/**
|
|
5203
|
-
* Retrieves a container builtin to the engine.
|
|
5204
|
-
* @param digest Digest of the image manifest
|
|
5205
|
-
*/
|
|
5206
|
-
builtinContainer = (digest) => {
|
|
5207
|
-
const ctx = this._ctx.select("builtinContainer", { digest });
|
|
5208
|
-
return new Container(ctx);
|
|
5209
|
-
};
|
|
5210
4696
|
/**
|
|
5211
4697
|
* Constructs a cache volume for a given cache key.
|
|
5212
4698
|
* @param key A string identifier to target this cache volume (e.g., "modules-cache").
|
|
@@ -5271,6 +4757,13 @@ export class Client extends BaseClient {
|
|
|
5271
4757
|
const ctx = this._ctx.select("engine");
|
|
5272
4758
|
return new Engine(ctx);
|
|
5273
4759
|
};
|
|
4760
|
+
/**
|
|
4761
|
+
* Initialize a new environment
|
|
4762
|
+
*/
|
|
4763
|
+
env = () => {
|
|
4764
|
+
const ctx = this._ctx.select("env");
|
|
4765
|
+
return new Env(ctx);
|
|
4766
|
+
};
|
|
5274
4767
|
/**
|
|
5275
4768
|
* Create a new error.
|
|
5276
4769
|
* @param message A brief description of the error.
|
|
@@ -5336,6 +4829,13 @@ export class Client extends BaseClient {
|
|
|
5336
4829
|
const ctx = this._ctx.select("llm", { ...opts });
|
|
5337
4830
|
return new LLM(ctx);
|
|
5338
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
|
+
};
|
|
5339
4839
|
/**
|
|
5340
4840
|
* Load a CacheVolume from its ID.
|
|
5341
4841
|
*/
|
|
@@ -5406,6 +4906,13 @@ export class Client extends BaseClient {
|
|
|
5406
4906
|
const ctx = this._ctx.select("loadEnumValueTypeDefFromID", { id });
|
|
5407
4907
|
return new EnumValueTypeDef(ctx);
|
|
5408
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
|
+
};
|
|
5409
4916
|
/**
|
|
5410
4917
|
* Load a EnvVariable from its ID.
|
|
5411
4918
|
*/
|
|
@@ -5519,11 +5026,11 @@ export class Client extends BaseClient {
|
|
|
5519
5026
|
return new LLM(ctx);
|
|
5520
5027
|
};
|
|
5521
5028
|
/**
|
|
5522
|
-
* Load a
|
|
5029
|
+
* Load a LLMTokenUsage from its ID.
|
|
5523
5030
|
*/
|
|
5524
|
-
|
|
5525
|
-
const ctx = this._ctx.select("
|
|
5526
|
-
return new
|
|
5031
|
+
loadLLMTokenUsageFromID = (id) => {
|
|
5032
|
+
const ctx = this._ctx.select("loadLLMTokenUsageFromID", { id });
|
|
5033
|
+
return new LLMTokenUsage(ctx);
|
|
5527
5034
|
};
|
|
5528
5035
|
/**
|
|
5529
5036
|
* Load a Label from its ID.
|