@dagger.io/dagger 0.16.3 → 0.17.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/api/client.gen.d.ts +864 -3
- package/dist/src/api/client.gen.d.ts.map +1 -1
- package/dist/src/api/client.gen.js +1648 -236
- package/dist/src/common/utils.d.ts +1 -1
- package/dist/src/common/utils.d.ts.map +1 -1
- package/dist/src/index.d.ts +0 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +0 -1
- package/dist/src/module/registry.d.ts.map +1 -1
- package/dist/src/provisioning/default.d.ts +1 -1
- package/dist/src/provisioning/default.js +1 -1
- package/dist/src/telemetry/init.d.ts.map +1 -1
- package/dist/src/telemetry/init.js +2 -3
- package/package.json +19 -19
|
@@ -1924,6 +1924,78 @@ export class Error extends BaseClient {
|
|
|
1924
1924
|
const response = await ctx.execute();
|
|
1925
1925
|
return response;
|
|
1926
1926
|
};
|
|
1927
|
+
/**
|
|
1928
|
+
* The extensions of the error.
|
|
1929
|
+
*/
|
|
1930
|
+
values = async () => {
|
|
1931
|
+
const ctx = this._ctx.select("values").select("id");
|
|
1932
|
+
const response = await ctx.execute();
|
|
1933
|
+
return response.map((r) => new Client(ctx.copy()).loadErrorValueFromID(r.id));
|
|
1934
|
+
};
|
|
1935
|
+
/**
|
|
1936
|
+
* Add a value to the error.
|
|
1937
|
+
* @param name The name of the value.
|
|
1938
|
+
* @param value The value to store on the error.
|
|
1939
|
+
*/
|
|
1940
|
+
withValue = (name, value) => {
|
|
1941
|
+
const ctx = this._ctx.select("withValue", { name, value });
|
|
1942
|
+
return new Error(ctx);
|
|
1943
|
+
};
|
|
1944
|
+
/**
|
|
1945
|
+
* Call the provided function with current Error.
|
|
1946
|
+
*
|
|
1947
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
1948
|
+
*/
|
|
1949
|
+
with = (arg) => {
|
|
1950
|
+
return arg(this);
|
|
1951
|
+
};
|
|
1952
|
+
}
|
|
1953
|
+
export class ErrorValue extends BaseClient {
|
|
1954
|
+
_id = undefined;
|
|
1955
|
+
_name = undefined;
|
|
1956
|
+
_value = undefined;
|
|
1957
|
+
/**
|
|
1958
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
1959
|
+
*/
|
|
1960
|
+
constructor(ctx, _id, _name, _value) {
|
|
1961
|
+
super(ctx);
|
|
1962
|
+
this._id = _id;
|
|
1963
|
+
this._name = _name;
|
|
1964
|
+
this._value = _value;
|
|
1965
|
+
}
|
|
1966
|
+
/**
|
|
1967
|
+
* A unique identifier for this ErrorValue.
|
|
1968
|
+
*/
|
|
1969
|
+
id = async () => {
|
|
1970
|
+
if (this._id) {
|
|
1971
|
+
return this._id;
|
|
1972
|
+
}
|
|
1973
|
+
const ctx = this._ctx.select("id");
|
|
1974
|
+
const response = await ctx.execute();
|
|
1975
|
+
return response;
|
|
1976
|
+
};
|
|
1977
|
+
/**
|
|
1978
|
+
* The name of the value.
|
|
1979
|
+
*/
|
|
1980
|
+
name = async () => {
|
|
1981
|
+
if (this._name) {
|
|
1982
|
+
return this._name;
|
|
1983
|
+
}
|
|
1984
|
+
const ctx = this._ctx.select("name");
|
|
1985
|
+
const response = await ctx.execute();
|
|
1986
|
+
return response;
|
|
1987
|
+
};
|
|
1988
|
+
/**
|
|
1989
|
+
* The value.
|
|
1990
|
+
*/
|
|
1991
|
+
value = async () => {
|
|
1992
|
+
if (this._value) {
|
|
1993
|
+
return this._value;
|
|
1994
|
+
}
|
|
1995
|
+
const ctx = this._ctx.select("value");
|
|
1996
|
+
const response = await ctx.execute();
|
|
1997
|
+
return response;
|
|
1998
|
+
};
|
|
1927
1999
|
}
|
|
1928
2000
|
/**
|
|
1929
2001
|
* A definition of a field on a custom object defined in a Module.
|
|
@@ -2561,292 +2633,1626 @@ export class GitRef extends BaseClient {
|
|
|
2561
2633
|
this._commit = _commit;
|
|
2562
2634
|
}
|
|
2563
2635
|
/**
|
|
2564
|
-
* A unique identifier for this GitRef.
|
|
2636
|
+
* A unique identifier for this GitRef.
|
|
2637
|
+
*/
|
|
2638
|
+
id = async () => {
|
|
2639
|
+
if (this._id) {
|
|
2640
|
+
return this._id;
|
|
2641
|
+
}
|
|
2642
|
+
const ctx = this._ctx.select("id");
|
|
2643
|
+
const response = await ctx.execute();
|
|
2644
|
+
return response;
|
|
2645
|
+
};
|
|
2646
|
+
/**
|
|
2647
|
+
* The resolved commit id at this ref.
|
|
2648
|
+
*/
|
|
2649
|
+
commit = async () => {
|
|
2650
|
+
if (this._commit) {
|
|
2651
|
+
return this._commit;
|
|
2652
|
+
}
|
|
2653
|
+
const ctx = this._ctx.select("commit");
|
|
2654
|
+
const response = await ctx.execute();
|
|
2655
|
+
return response;
|
|
2656
|
+
};
|
|
2657
|
+
/**
|
|
2658
|
+
* The filesystem tree at this ref.
|
|
2659
|
+
* @param opts.discardGitDir Set to true to discard .git directory.
|
|
2660
|
+
*/
|
|
2661
|
+
tree = (opts) => {
|
|
2662
|
+
const ctx = this._ctx.select("tree", { ...opts });
|
|
2663
|
+
return new Directory(ctx);
|
|
2664
|
+
};
|
|
2665
|
+
}
|
|
2666
|
+
/**
|
|
2667
|
+
* A git repository.
|
|
2668
|
+
*/
|
|
2669
|
+
export class GitRepository extends BaseClient {
|
|
2670
|
+
_id = undefined;
|
|
2671
|
+
/**
|
|
2672
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2673
|
+
*/
|
|
2674
|
+
constructor(ctx, _id) {
|
|
2675
|
+
super(ctx);
|
|
2676
|
+
this._id = _id;
|
|
2677
|
+
}
|
|
2678
|
+
/**
|
|
2679
|
+
* A unique identifier for this GitRepository.
|
|
2680
|
+
*/
|
|
2681
|
+
id = async () => {
|
|
2682
|
+
if (this._id) {
|
|
2683
|
+
return this._id;
|
|
2684
|
+
}
|
|
2685
|
+
const ctx = this._ctx.select("id");
|
|
2686
|
+
const response = await ctx.execute();
|
|
2687
|
+
return response;
|
|
2688
|
+
};
|
|
2689
|
+
/**
|
|
2690
|
+
* Returns details of a branch.
|
|
2691
|
+
* @param name Branch's name (e.g., "main").
|
|
2692
|
+
*/
|
|
2693
|
+
branch = (name) => {
|
|
2694
|
+
const ctx = this._ctx.select("branch", { name });
|
|
2695
|
+
return new GitRef(ctx);
|
|
2696
|
+
};
|
|
2697
|
+
/**
|
|
2698
|
+
* Returns details of a commit.
|
|
2699
|
+
* @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
|
|
2700
|
+
*/
|
|
2701
|
+
commit = (id) => {
|
|
2702
|
+
const ctx = this._ctx.select("commit", { id });
|
|
2703
|
+
return new GitRef(ctx);
|
|
2704
|
+
};
|
|
2705
|
+
/**
|
|
2706
|
+
* Returns details for HEAD.
|
|
2707
|
+
*/
|
|
2708
|
+
head = () => {
|
|
2709
|
+
const ctx = this._ctx.select("head");
|
|
2710
|
+
return new GitRef(ctx);
|
|
2711
|
+
};
|
|
2712
|
+
/**
|
|
2713
|
+
* Returns details of a ref.
|
|
2714
|
+
* @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
|
|
2715
|
+
*/
|
|
2716
|
+
ref = (name) => {
|
|
2717
|
+
const ctx = this._ctx.select("ref", { name });
|
|
2718
|
+
return new GitRef(ctx);
|
|
2719
|
+
};
|
|
2720
|
+
/**
|
|
2721
|
+
* Returns details of a tag.
|
|
2722
|
+
* @param name Tag's name (e.g., "v0.3.9").
|
|
2723
|
+
*/
|
|
2724
|
+
tag = (name) => {
|
|
2725
|
+
const ctx = this._ctx.select("tag", { name });
|
|
2726
|
+
return new GitRef(ctx);
|
|
2727
|
+
};
|
|
2728
|
+
/**
|
|
2729
|
+
* tags that match any of the given glob patterns.
|
|
2730
|
+
* @param opts.patterns Glob patterns (e.g., "refs/tags/v*").
|
|
2731
|
+
*/
|
|
2732
|
+
tags = async (opts) => {
|
|
2733
|
+
const ctx = this._ctx.select("tags", { ...opts });
|
|
2734
|
+
const response = await ctx.execute();
|
|
2735
|
+
return response;
|
|
2736
|
+
};
|
|
2737
|
+
/**
|
|
2738
|
+
* Header to authenticate the remote with.
|
|
2739
|
+
* @param header Secret used to populate the Authorization HTTP header
|
|
2740
|
+
*/
|
|
2741
|
+
withAuthHeader = (header) => {
|
|
2742
|
+
const ctx = this._ctx.select("withAuthHeader", { header });
|
|
2743
|
+
return new GitRepository(ctx);
|
|
2744
|
+
};
|
|
2745
|
+
/**
|
|
2746
|
+
* Token to authenticate the remote with.
|
|
2747
|
+
* @param token Secret used to populate the password during basic HTTP Authorization
|
|
2748
|
+
*/
|
|
2749
|
+
withAuthToken = (token) => {
|
|
2750
|
+
const ctx = this._ctx.select("withAuthToken", { token });
|
|
2751
|
+
return new GitRepository(ctx);
|
|
2752
|
+
};
|
|
2753
|
+
/**
|
|
2754
|
+
* Call the provided function with current GitRepository.
|
|
2755
|
+
*
|
|
2756
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
2757
|
+
*/
|
|
2758
|
+
with = (arg) => {
|
|
2759
|
+
return arg(this);
|
|
2760
|
+
};
|
|
2761
|
+
}
|
|
2762
|
+
/**
|
|
2763
|
+
* Information about the host environment.
|
|
2764
|
+
*/
|
|
2765
|
+
export class Host extends BaseClient {
|
|
2766
|
+
_id = undefined;
|
|
2767
|
+
/**
|
|
2768
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2769
|
+
*/
|
|
2770
|
+
constructor(ctx, _id) {
|
|
2771
|
+
super(ctx);
|
|
2772
|
+
this._id = _id;
|
|
2773
|
+
}
|
|
2774
|
+
/**
|
|
2775
|
+
* A unique identifier for this Host.
|
|
2776
|
+
*/
|
|
2777
|
+
id = async () => {
|
|
2778
|
+
if (this._id) {
|
|
2779
|
+
return this._id;
|
|
2780
|
+
}
|
|
2781
|
+
const ctx = this._ctx.select("id");
|
|
2782
|
+
const response = await ctx.execute();
|
|
2783
|
+
return response;
|
|
2784
|
+
};
|
|
2785
|
+
/**
|
|
2786
|
+
* Accesses a directory on the host.
|
|
2787
|
+
* @param path Location of the directory to access (e.g., ".").
|
|
2788
|
+
* @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
|
|
2789
|
+
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
2790
|
+
*/
|
|
2791
|
+
directory = (path, opts) => {
|
|
2792
|
+
const ctx = this._ctx.select("directory", { path, ...opts });
|
|
2793
|
+
return new Directory(ctx);
|
|
2794
|
+
};
|
|
2795
|
+
/**
|
|
2796
|
+
* Accesses a file on the host.
|
|
2797
|
+
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
2798
|
+
*/
|
|
2799
|
+
file = (path) => {
|
|
2800
|
+
const ctx = this._ctx.select("file", { path });
|
|
2801
|
+
return new File(ctx);
|
|
2802
|
+
};
|
|
2803
|
+
/**
|
|
2804
|
+
* Creates a service that forwards traffic to a specified address via the host.
|
|
2805
|
+
* @param opts.host Upstream host to forward traffic to.
|
|
2806
|
+
* @param opts.ports Ports to expose via the service, forwarding through the host network.
|
|
2807
|
+
*
|
|
2808
|
+
* If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
|
|
2809
|
+
*
|
|
2810
|
+
* An empty set of ports is not valid; an error will be returned.
|
|
2811
|
+
*/
|
|
2812
|
+
service = (opts) => {
|
|
2813
|
+
const ctx = this._ctx.select("service", { ...opts });
|
|
2814
|
+
return new Service(ctx);
|
|
2815
|
+
};
|
|
2816
|
+
/**
|
|
2817
|
+
* Sets a secret given a user-defined name and the file path on the host, and returns the secret.
|
|
2818
|
+
*
|
|
2819
|
+
* The file is limited to a size of 512000 bytes.
|
|
2820
|
+
* @param name The user defined name for this secret.
|
|
2821
|
+
* @param path Location of the file to set as a secret.
|
|
2822
|
+
*/
|
|
2823
|
+
setSecretFile = (name, path) => {
|
|
2824
|
+
const ctx = this._ctx.select("setSecretFile", { name, path });
|
|
2825
|
+
return new Secret(ctx);
|
|
2826
|
+
};
|
|
2827
|
+
/**
|
|
2828
|
+
* Creates a tunnel that forwards traffic from the host to a service.
|
|
2829
|
+
* @param service Service to send traffic from the tunnel.
|
|
2830
|
+
* @param opts.ports Configure explicit port forwarding rules for the tunnel.
|
|
2831
|
+
*
|
|
2832
|
+
* If a port's frontend is unspecified or 0, a random port will be chosen by the host.
|
|
2833
|
+
*
|
|
2834
|
+
* If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
|
|
2835
|
+
*
|
|
2836
|
+
* If ports are given and native is true, the ports are additive.
|
|
2837
|
+
* @param opts.native Map each service port to the same port on the host, as if the service were running natively.
|
|
2838
|
+
*
|
|
2839
|
+
* Note: enabling may result in port conflicts.
|
|
2840
|
+
*/
|
|
2841
|
+
tunnel = (service, opts) => {
|
|
2842
|
+
const ctx = this._ctx.select("tunnel", { service, ...opts });
|
|
2843
|
+
return new Service(ctx);
|
|
2844
|
+
};
|
|
2845
|
+
/**
|
|
2846
|
+
* Accesses a Unix socket on the host.
|
|
2847
|
+
* @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
|
|
2848
|
+
*/
|
|
2849
|
+
unixSocket = (path) => {
|
|
2850
|
+
const ctx = this._ctx.select("unixSocket", { path });
|
|
2851
|
+
return new Socket(ctx);
|
|
2852
|
+
};
|
|
2853
|
+
}
|
|
2854
|
+
/**
|
|
2855
|
+
* A graphql input type, which is essentially just a group of named args.
|
|
2856
|
+
* This is currently only used to represent pre-existing usage of graphql input types
|
|
2857
|
+
* in the core API. It is not used by user modules and shouldn't ever be as user
|
|
2858
|
+
* module accept input objects via their id rather than graphql input types.
|
|
2859
|
+
*/
|
|
2860
|
+
export class InputTypeDef extends BaseClient {
|
|
2861
|
+
_id = undefined;
|
|
2862
|
+
_name = undefined;
|
|
2863
|
+
/**
|
|
2864
|
+
* Constructor is used for internal usage only, do not create object from it.
|
|
2865
|
+
*/
|
|
2866
|
+
constructor(ctx, _id, _name) {
|
|
2867
|
+
super(ctx);
|
|
2868
|
+
this._id = _id;
|
|
2869
|
+
this._name = _name;
|
|
2870
|
+
}
|
|
2871
|
+
/**
|
|
2872
|
+
* A unique identifier for this InputTypeDef.
|
|
2873
|
+
*/
|
|
2874
|
+
id = async () => {
|
|
2875
|
+
if (this._id) {
|
|
2876
|
+
return this._id;
|
|
2877
|
+
}
|
|
2878
|
+
const ctx = this._ctx.select("id");
|
|
2879
|
+
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);
|
|
3892
|
+
};
|
|
3893
|
+
/**
|
|
3894
|
+
* Retrieve a the current value in the LLM environment, of type Terminal
|
|
3895
|
+
*/
|
|
3896
|
+
terminal = () => {
|
|
3897
|
+
const ctx = this._ctx.select("terminal");
|
|
3898
|
+
return new Terminal(ctx);
|
|
3899
|
+
};
|
|
3900
|
+
/**
|
|
3901
|
+
* print documentation for available tools
|
|
3902
|
+
*/
|
|
3903
|
+
tools = async () => {
|
|
3904
|
+
if (this._tools) {
|
|
3905
|
+
return this._tools;
|
|
3906
|
+
}
|
|
3907
|
+
const ctx = this._ctx.select("tools");
|
|
3908
|
+
const response = await ctx.execute();
|
|
3909
|
+
return response;
|
|
3910
|
+
};
|
|
3911
|
+
/**
|
|
3912
|
+
* Retrieve a the current value in the LLM environment, of type TypeDef
|
|
3913
|
+
*/
|
|
3914
|
+
typeDef = () => {
|
|
3915
|
+
const ctx = this._ctx.select("typeDef");
|
|
3916
|
+
return new TypeDef(ctx);
|
|
3917
|
+
};
|
|
3918
|
+
/**
|
|
3919
|
+
* list variables in the LLM environment
|
|
3920
|
+
*/
|
|
3921
|
+
variables = async () => {
|
|
3922
|
+
const ctx = this._ctx.select("variables").select("id");
|
|
3923
|
+
const response = await ctx.execute();
|
|
3924
|
+
return response.map((r) => new Client(ctx.copy()).loadLLMVariableFromID(r.id));
|
|
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);
|
|
3933
|
+
};
|
|
3934
|
+
/**
|
|
3935
|
+
* Set a variable of type Container in the llm environment
|
|
3936
|
+
* @param value The Container value to assign to the variable
|
|
3937
|
+
*/
|
|
3938
|
+
withContainer = (value) => {
|
|
3939
|
+
const ctx = this._ctx.select("withContainer", { value });
|
|
3940
|
+
return new LLM(ctx);
|
|
3941
|
+
};
|
|
3942
|
+
/**
|
|
3943
|
+
* Set a variable of type CurrentModule in the llm environment
|
|
3944
|
+
* @param value The CurrentModule value to assign to the variable
|
|
3945
|
+
*/
|
|
3946
|
+
withCurrentModule = (value) => {
|
|
3947
|
+
const ctx = this._ctx.select("withCurrentModule", { value });
|
|
3948
|
+
return new LLM(ctx);
|
|
3949
|
+
};
|
|
3950
|
+
/**
|
|
3951
|
+
* Set a variable of type Directory in the llm environment
|
|
3952
|
+
* @param value The Directory value to assign to the variable
|
|
3953
|
+
*/
|
|
3954
|
+
withDirectory = (value) => {
|
|
3955
|
+
const ctx = this._ctx.select("withDirectory", { value });
|
|
3956
|
+
return new LLM(ctx);
|
|
3957
|
+
};
|
|
3958
|
+
/**
|
|
3959
|
+
* Set a variable of type EnumTypeDef in the llm environment
|
|
3960
|
+
* @param value The EnumTypeDef value to assign to the variable
|
|
3961
|
+
*/
|
|
3962
|
+
withEnumTypeDef = (value) => {
|
|
3963
|
+
const ctx = this._ctx.select("withEnumTypeDef", { value });
|
|
3964
|
+
return new LLM(ctx);
|
|
3965
|
+
};
|
|
3966
|
+
/**
|
|
3967
|
+
* Set a variable of type EnumValueTypeDef in the llm environment
|
|
3968
|
+
* @param value The EnumValueTypeDef value to assign to the variable
|
|
3969
|
+
*/
|
|
3970
|
+
withEnumValueTypeDef = (value) => {
|
|
3971
|
+
const ctx = this._ctx.select("withEnumValueTypeDef", { value });
|
|
3972
|
+
return new LLM(ctx);
|
|
3973
|
+
};
|
|
3974
|
+
/**
|
|
3975
|
+
* Set a variable of type Error in the llm environment
|
|
3976
|
+
* @param value The Error value to assign to the variable
|
|
3977
|
+
*/
|
|
3978
|
+
withError = (value) => {
|
|
3979
|
+
const ctx = this._ctx.select("withError", { value });
|
|
3980
|
+
return new LLM(ctx);
|
|
3981
|
+
};
|
|
3982
|
+
/**
|
|
3983
|
+
* Set a variable of type ErrorValue in the llm environment
|
|
3984
|
+
* @param value The ErrorValue value to assign to the variable
|
|
3985
|
+
*/
|
|
3986
|
+
withErrorValue = (value) => {
|
|
3987
|
+
const ctx = this._ctx.select("withErrorValue", { value });
|
|
3988
|
+
return new LLM(ctx);
|
|
3989
|
+
};
|
|
3990
|
+
/**
|
|
3991
|
+
* Set a variable of type FieldTypeDef in the llm environment
|
|
3992
|
+
* @param value The FieldTypeDef value to assign to the variable
|
|
3993
|
+
*/
|
|
3994
|
+
withFieldTypeDef = (value) => {
|
|
3995
|
+
const ctx = this._ctx.select("withFieldTypeDef", { value });
|
|
3996
|
+
return new LLM(ctx);
|
|
3997
|
+
};
|
|
3998
|
+
/**
|
|
3999
|
+
* Set a variable of type File in the llm environment
|
|
4000
|
+
* @param value The File value to assign to the variable
|
|
4001
|
+
*/
|
|
4002
|
+
withFile = (value) => {
|
|
4003
|
+
const ctx = this._ctx.select("withFile", { value });
|
|
4004
|
+
return new LLM(ctx);
|
|
4005
|
+
};
|
|
4006
|
+
/**
|
|
4007
|
+
* Set a variable of type Function in the llm environment
|
|
4008
|
+
* @param value The Function value to assign to the variable
|
|
4009
|
+
*/
|
|
4010
|
+
withFunction = (value) => {
|
|
4011
|
+
const ctx = this._ctx.select("withFunction", { value });
|
|
4012
|
+
return new LLM(ctx);
|
|
4013
|
+
};
|
|
4014
|
+
/**
|
|
4015
|
+
* Set a variable of type FunctionArg in the llm environment
|
|
4016
|
+
* @param value The FunctionArg value to assign to the variable
|
|
4017
|
+
*/
|
|
4018
|
+
withFunctionArg = (value) => {
|
|
4019
|
+
const ctx = this._ctx.select("withFunctionArg", { value });
|
|
4020
|
+
return new LLM(ctx);
|
|
4021
|
+
};
|
|
4022
|
+
/**
|
|
4023
|
+
* Set a variable of type FunctionCall in the llm environment
|
|
4024
|
+
* @param value The FunctionCall value to assign to the variable
|
|
2565
4025
|
*/
|
|
2566
|
-
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
}
|
|
2570
|
-
const ctx = this._ctx.select("id");
|
|
2571
|
-
const response = await ctx.execute();
|
|
2572
|
-
return response;
|
|
4026
|
+
withFunctionCall = (value) => {
|
|
4027
|
+
const ctx = this._ctx.select("withFunctionCall", { value });
|
|
4028
|
+
return new LLM(ctx);
|
|
2573
4029
|
};
|
|
2574
4030
|
/**
|
|
2575
|
-
*
|
|
4031
|
+
* Set a variable of type FunctionCallArgValue in the llm environment
|
|
4032
|
+
* @param value The FunctionCallArgValue value to assign to the variable
|
|
2576
4033
|
*/
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
}
|
|
2581
|
-
const ctx = this._ctx.select("commit");
|
|
2582
|
-
const response = await ctx.execute();
|
|
2583
|
-
return response;
|
|
4034
|
+
withFunctionCallArgValue = (value) => {
|
|
4035
|
+
const ctx = this._ctx.select("withFunctionCallArgValue", { value });
|
|
4036
|
+
return new LLM(ctx);
|
|
2584
4037
|
};
|
|
2585
4038
|
/**
|
|
2586
|
-
*
|
|
2587
|
-
* @param
|
|
4039
|
+
* Set a variable of type GeneratedCode in the llm environment
|
|
4040
|
+
* @param value The GeneratedCode value to assign to the variable
|
|
2588
4041
|
*/
|
|
2589
|
-
|
|
2590
|
-
const ctx = this._ctx.select("
|
|
2591
|
-
return new
|
|
4042
|
+
withGeneratedCode = (value) => {
|
|
4043
|
+
const ctx = this._ctx.select("withGeneratedCode", { value });
|
|
4044
|
+
return new LLM(ctx);
|
|
2592
4045
|
};
|
|
2593
|
-
}
|
|
2594
|
-
/**
|
|
2595
|
-
* A git repository.
|
|
2596
|
-
*/
|
|
2597
|
-
export class GitRepository extends BaseClient {
|
|
2598
|
-
_id = undefined;
|
|
2599
4046
|
/**
|
|
2600
|
-
*
|
|
4047
|
+
* Set a variable of type GitRef in the llm environment
|
|
4048
|
+
* @param value The GitRef value to assign to the variable
|
|
2601
4049
|
*/
|
|
2602
|
-
|
|
2603
|
-
|
|
2604
|
-
|
|
2605
|
-
}
|
|
4050
|
+
withGitRef = (value) => {
|
|
4051
|
+
const ctx = this._ctx.select("withGitRef", { value });
|
|
4052
|
+
return new LLM(ctx);
|
|
4053
|
+
};
|
|
2606
4054
|
/**
|
|
2607
|
-
*
|
|
4055
|
+
* Set a variable of type GitRepository in the llm environment
|
|
4056
|
+
* @param value The GitRepository value to assign to the variable
|
|
2608
4057
|
*/
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
}
|
|
2613
|
-
const ctx = this._ctx.select("id");
|
|
2614
|
-
const response = await ctx.execute();
|
|
2615
|
-
return response;
|
|
4058
|
+
withGitRepository = (value) => {
|
|
4059
|
+
const ctx = this._ctx.select("withGitRepository", { value });
|
|
4060
|
+
return new LLM(ctx);
|
|
2616
4061
|
};
|
|
2617
4062
|
/**
|
|
2618
|
-
*
|
|
2619
|
-
* @param
|
|
4063
|
+
* Set a variable of type InputTypeDef in the llm environment
|
|
4064
|
+
* @param value The InputTypeDef value to assign to the variable
|
|
2620
4065
|
*/
|
|
2621
|
-
|
|
2622
|
-
const ctx = this._ctx.select("
|
|
2623
|
-
return new
|
|
4066
|
+
withInputTypeDef = (value) => {
|
|
4067
|
+
const ctx = this._ctx.select("withInputTypeDef", { value });
|
|
4068
|
+
return new LLM(ctx);
|
|
2624
4069
|
};
|
|
2625
4070
|
/**
|
|
2626
|
-
*
|
|
2627
|
-
* @param
|
|
4071
|
+
* Set a variable of type InterfaceTypeDef in the llm environment
|
|
4072
|
+
* @param value The InterfaceTypeDef value to assign to the variable
|
|
2628
4073
|
*/
|
|
2629
|
-
|
|
2630
|
-
const ctx = this._ctx.select("
|
|
2631
|
-
return new
|
|
4074
|
+
withInterfaceTypeDef = (value) => {
|
|
4075
|
+
const ctx = this._ctx.select("withInterfaceTypeDef", { value });
|
|
4076
|
+
return new LLM(ctx);
|
|
2632
4077
|
};
|
|
2633
4078
|
/**
|
|
2634
|
-
*
|
|
4079
|
+
* Set a variable of type LLM in the llm environment
|
|
4080
|
+
* @param value The LLM value to assign to the variable
|
|
2635
4081
|
*/
|
|
2636
|
-
|
|
2637
|
-
const ctx = this._ctx.select("
|
|
2638
|
-
return new
|
|
4082
|
+
withLLM = (value) => {
|
|
4083
|
+
const ctx = this._ctx.select("withLLM", { value });
|
|
4084
|
+
return new LLM(ctx);
|
|
2639
4085
|
};
|
|
2640
4086
|
/**
|
|
2641
|
-
*
|
|
2642
|
-
* @param
|
|
4087
|
+
* Set a variable of type ListTypeDef in the llm environment
|
|
4088
|
+
* @param value The ListTypeDef value to assign to the variable
|
|
2643
4089
|
*/
|
|
2644
|
-
|
|
2645
|
-
const ctx = this._ctx.select("
|
|
2646
|
-
return new
|
|
4090
|
+
withListTypeDef = (value) => {
|
|
4091
|
+
const ctx = this._ctx.select("withListTypeDef", { value });
|
|
4092
|
+
return new LLM(ctx);
|
|
2647
4093
|
};
|
|
2648
4094
|
/**
|
|
2649
|
-
*
|
|
2650
|
-
* @param
|
|
4095
|
+
* swap out the llm model
|
|
4096
|
+
* @param model The model to use
|
|
2651
4097
|
*/
|
|
2652
|
-
|
|
2653
|
-
const ctx = this._ctx.select("
|
|
2654
|
-
return new
|
|
4098
|
+
withModel = (model) => {
|
|
4099
|
+
const ctx = this._ctx.select("withModel", { model });
|
|
4100
|
+
return new LLM(ctx);
|
|
2655
4101
|
};
|
|
2656
4102
|
/**
|
|
2657
|
-
*
|
|
2658
|
-
* @param
|
|
4103
|
+
* Set a variable of type Module in the llm environment
|
|
4104
|
+
* @param value The Module value to assign to the variable
|
|
2659
4105
|
*/
|
|
2660
|
-
|
|
2661
|
-
const ctx = this._ctx.select("
|
|
2662
|
-
|
|
2663
|
-
return response;
|
|
4106
|
+
withModule = (value) => {
|
|
4107
|
+
const ctx = this._ctx.select("withModule", { value });
|
|
4108
|
+
return new LLM(ctx);
|
|
2664
4109
|
};
|
|
2665
4110
|
/**
|
|
2666
|
-
*
|
|
2667
|
-
* @param
|
|
4111
|
+
* Set a variable of type ModuleConfigClient in the llm environment
|
|
4112
|
+
* @param value The ModuleConfigClient value to assign to the variable
|
|
2668
4113
|
*/
|
|
2669
|
-
|
|
2670
|
-
const ctx = this._ctx.select("
|
|
2671
|
-
return new
|
|
4114
|
+
withModuleConfigClient = (value) => {
|
|
4115
|
+
const ctx = this._ctx.select("withModuleConfigClient", { value });
|
|
4116
|
+
return new LLM(ctx);
|
|
2672
4117
|
};
|
|
2673
4118
|
/**
|
|
2674
|
-
*
|
|
2675
|
-
* @param
|
|
4119
|
+
* Set a variable of type ModuleSource in the llm environment
|
|
4120
|
+
* @param value The ModuleSource value to assign to the variable
|
|
2676
4121
|
*/
|
|
2677
|
-
|
|
2678
|
-
const ctx = this._ctx.select("
|
|
2679
|
-
return new
|
|
4122
|
+
withModuleSource = (value) => {
|
|
4123
|
+
const ctx = this._ctx.select("withModuleSource", { value });
|
|
4124
|
+
return new LLM(ctx);
|
|
2680
4125
|
};
|
|
2681
4126
|
/**
|
|
2682
|
-
*
|
|
2683
|
-
*
|
|
2684
|
-
* This is useful for reusability and readability by not breaking the calling chain.
|
|
4127
|
+
* Set a variable of type ObjectTypeDef in the llm environment
|
|
4128
|
+
* @param value The ObjectTypeDef value to assign to the variable
|
|
2685
4129
|
*/
|
|
2686
|
-
|
|
2687
|
-
|
|
4130
|
+
withObjectTypeDef = (value) => {
|
|
4131
|
+
const ctx = this._ctx.select("withObjectTypeDef", { value });
|
|
4132
|
+
return new LLM(ctx);
|
|
2688
4133
|
};
|
|
2689
|
-
}
|
|
2690
|
-
/**
|
|
2691
|
-
* Information about the host environment.
|
|
2692
|
-
*/
|
|
2693
|
-
export class Host extends BaseClient {
|
|
2694
|
-
_id = undefined;
|
|
2695
4134
|
/**
|
|
2696
|
-
*
|
|
4135
|
+
* append a prompt to the llm context
|
|
4136
|
+
* @param prompt The prompt to send
|
|
2697
4137
|
*/
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
|
|
2701
|
-
}
|
|
4138
|
+
withPrompt = (prompt) => {
|
|
4139
|
+
const ctx = this._ctx.select("withPrompt", { prompt });
|
|
4140
|
+
return new LLM(ctx);
|
|
4141
|
+
};
|
|
2702
4142
|
/**
|
|
2703
|
-
*
|
|
4143
|
+
* append the contents of a file to the llm context
|
|
4144
|
+
* @param file The file to read the prompt from
|
|
2704
4145
|
*/
|
|
2705
|
-
|
|
2706
|
-
|
|
2707
|
-
|
|
2708
|
-
}
|
|
2709
|
-
const ctx = this._ctx.select("id");
|
|
2710
|
-
const response = await ctx.execute();
|
|
2711
|
-
return response;
|
|
4146
|
+
withPromptFile = (file) => {
|
|
4147
|
+
const ctx = this._ctx.select("withPromptFile", { file });
|
|
4148
|
+
return new LLM(ctx);
|
|
2712
4149
|
};
|
|
2713
4150
|
/**
|
|
2714
|
-
*
|
|
2715
|
-
* @param
|
|
2716
|
-
* @param
|
|
2717
|
-
* @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
|
|
4151
|
+
* Add a string variable to the LLM's environment
|
|
4152
|
+
* @param name The variable name
|
|
4153
|
+
* @param value The variable value
|
|
2718
4154
|
*/
|
|
2719
|
-
|
|
2720
|
-
const ctx = this._ctx.select("
|
|
2721
|
-
return new
|
|
4155
|
+
withPromptVar = (name, value) => {
|
|
4156
|
+
const ctx = this._ctx.select("withPromptVar", { name, value });
|
|
4157
|
+
return new LLM(ctx);
|
|
2722
4158
|
};
|
|
2723
4159
|
/**
|
|
2724
|
-
*
|
|
2725
|
-
* @param path Location of the file to retrieve (e.g., "README.md").
|
|
4160
|
+
* Provide the entire Query object to the LLM
|
|
2726
4161
|
*/
|
|
2727
|
-
|
|
2728
|
-
const ctx = this._ctx.select("
|
|
2729
|
-
return new
|
|
4162
|
+
withQuery = () => {
|
|
4163
|
+
const ctx = this._ctx.select("withQuery");
|
|
4164
|
+
return new LLM(ctx);
|
|
2730
4165
|
};
|
|
2731
4166
|
/**
|
|
2732
|
-
*
|
|
2733
|
-
* @param
|
|
2734
|
-
* @param opts.ports Ports to expose via the service, forwarding through the host network.
|
|
2735
|
-
*
|
|
2736
|
-
* If a port's frontend is unspecified or 0, it defaults to the same as the backend port.
|
|
2737
|
-
*
|
|
2738
|
-
* An empty set of ports is not valid; an error will be returned.
|
|
4167
|
+
* Set a variable of type SDKConfig in the llm environment
|
|
4168
|
+
* @param value The SDKConfig value to assign to the variable
|
|
2739
4169
|
*/
|
|
2740
|
-
|
|
2741
|
-
const ctx = this._ctx.select("
|
|
2742
|
-
return new
|
|
4170
|
+
withSDKConfig = (value) => {
|
|
4171
|
+
const ctx = this._ctx.select("withSDKConfig", { value });
|
|
4172
|
+
return new LLM(ctx);
|
|
2743
4173
|
};
|
|
2744
4174
|
/**
|
|
2745
|
-
*
|
|
2746
|
-
*
|
|
2747
|
-
* The file is limited to a size of 512000 bytes.
|
|
2748
|
-
* @param name The user defined name for this secret.
|
|
2749
|
-
* @param path Location of the file to set as a secret.
|
|
4175
|
+
* Set a variable of type ScalarTypeDef in the llm environment
|
|
4176
|
+
* @param value The ScalarTypeDef value to assign to the variable
|
|
2750
4177
|
*/
|
|
2751
|
-
|
|
2752
|
-
const ctx = this._ctx.select("
|
|
2753
|
-
return new
|
|
4178
|
+
withScalarTypeDef = (value) => {
|
|
4179
|
+
const ctx = this._ctx.select("withScalarTypeDef", { value });
|
|
4180
|
+
return new LLM(ctx);
|
|
2754
4181
|
};
|
|
2755
4182
|
/**
|
|
2756
|
-
*
|
|
2757
|
-
* @param
|
|
2758
|
-
* @param opts.ports Configure explicit port forwarding rules for the tunnel.
|
|
2759
|
-
*
|
|
2760
|
-
* If a port's frontend is unspecified or 0, a random port will be chosen by the host.
|
|
2761
|
-
*
|
|
2762
|
-
* If no ports are given, all of the service's ports are forwarded. If native is true, each port maps to the same port on the host. If native is false, each port maps to a random port chosen by the host.
|
|
2763
|
-
*
|
|
2764
|
-
* If ports are given and native is true, the ports are additive.
|
|
2765
|
-
* @param opts.native Map each service port to the same port on the host, as if the service were running natively.
|
|
2766
|
-
*
|
|
2767
|
-
* Note: enabling may result in port conflicts.
|
|
4183
|
+
* Set a variable of type Secret in the llm environment
|
|
4184
|
+
* @param value The Secret value to assign to the variable
|
|
2768
4185
|
*/
|
|
2769
|
-
|
|
2770
|
-
const ctx = this._ctx.select("
|
|
2771
|
-
return new
|
|
4186
|
+
withSecret = (value) => {
|
|
4187
|
+
const ctx = this._ctx.select("withSecret", { value });
|
|
4188
|
+
return new LLM(ctx);
|
|
2772
4189
|
};
|
|
2773
4190
|
/**
|
|
2774
|
-
*
|
|
2775
|
-
* @param
|
|
4191
|
+
* Set a variable of type Service in the llm environment
|
|
4192
|
+
* @param value The Service value to assign to the variable
|
|
2776
4193
|
*/
|
|
2777
|
-
|
|
2778
|
-
const ctx = this._ctx.select("
|
|
2779
|
-
return new
|
|
4194
|
+
withService = (value) => {
|
|
4195
|
+
const ctx = this._ctx.select("withService", { value });
|
|
4196
|
+
return new LLM(ctx);
|
|
2780
4197
|
};
|
|
2781
|
-
}
|
|
2782
|
-
/**
|
|
2783
|
-
* A graphql input type, which is essentially just a group of named args.
|
|
2784
|
-
* This is currently only used to represent pre-existing usage of graphql input types
|
|
2785
|
-
* in the core API. It is not used by user modules and shouldn't ever be as user
|
|
2786
|
-
* module accept input objects via their id rather than graphql input types.
|
|
2787
|
-
*/
|
|
2788
|
-
export class InputTypeDef extends BaseClient {
|
|
2789
|
-
_id = undefined;
|
|
2790
|
-
_name = undefined;
|
|
2791
4198
|
/**
|
|
2792
|
-
*
|
|
4199
|
+
* Set a variable of type Socket in the llm environment
|
|
4200
|
+
* @param value The Socket value to assign to the variable
|
|
2793
4201
|
*/
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
|
|
2798
|
-
}
|
|
4202
|
+
withSocket = (value) => {
|
|
4203
|
+
const ctx = this._ctx.select("withSocket", { value });
|
|
4204
|
+
return new LLM(ctx);
|
|
4205
|
+
};
|
|
2799
4206
|
/**
|
|
2800
|
-
*
|
|
4207
|
+
* Set a variable of type SourceMap in the llm environment
|
|
4208
|
+
* @param value The SourceMap value to assign to the variable
|
|
2801
4209
|
*/
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
}
|
|
2806
|
-
const ctx = this._ctx.select("id");
|
|
2807
|
-
const response = await ctx.execute();
|
|
2808
|
-
return response;
|
|
4210
|
+
withSourceMap = (value) => {
|
|
4211
|
+
const ctx = this._ctx.select("withSourceMap", { value });
|
|
4212
|
+
return new LLM(ctx);
|
|
2809
4213
|
};
|
|
2810
4214
|
/**
|
|
2811
|
-
*
|
|
4215
|
+
* Set a variable of type Terminal in the llm environment
|
|
4216
|
+
* @param value The Terminal value to assign to the variable
|
|
2812
4217
|
*/
|
|
2813
|
-
|
|
2814
|
-
const ctx = this._ctx.select("
|
|
2815
|
-
|
|
2816
|
-
return response.map((r) => new Client(ctx.copy()).loadFieldTypeDefFromID(r.id));
|
|
4218
|
+
withTerminal = (value) => {
|
|
4219
|
+
const ctx = this._ctx.select("withTerminal", { value });
|
|
4220
|
+
return new LLM(ctx);
|
|
2817
4221
|
};
|
|
2818
4222
|
/**
|
|
2819
|
-
*
|
|
4223
|
+
* Set a variable of type TypeDef in the llm environment
|
|
4224
|
+
* @param value The TypeDef value to assign to the variable
|
|
2820
4225
|
*/
|
|
2821
|
-
|
|
2822
|
-
|
|
2823
|
-
|
|
2824
|
-
|
|
2825
|
-
|
|
2826
|
-
|
|
2827
|
-
|
|
4226
|
+
withTypeDef = (value) => {
|
|
4227
|
+
const ctx = this._ctx.select("withTypeDef", { value });
|
|
4228
|
+
return new LLM(ctx);
|
|
4229
|
+
};
|
|
4230
|
+
/**
|
|
4231
|
+
* Call the provided function with current LLM.
|
|
4232
|
+
*
|
|
4233
|
+
* This is useful for reusability and readability by not breaking the calling chain.
|
|
4234
|
+
*/
|
|
4235
|
+
with = (arg) => {
|
|
4236
|
+
return arg(this);
|
|
2828
4237
|
};
|
|
2829
4238
|
}
|
|
2830
|
-
|
|
2831
|
-
* A definition of a custom interface defined in a Module.
|
|
2832
|
-
*/
|
|
2833
|
-
export class InterfaceTypeDef extends BaseClient {
|
|
4239
|
+
export class LLMVariable extends BaseClient {
|
|
2834
4240
|
_id = undefined;
|
|
2835
|
-
|
|
4241
|
+
_hash = undefined;
|
|
2836
4242
|
_name = undefined;
|
|
2837
|
-
|
|
4243
|
+
_typeName = undefined;
|
|
2838
4244
|
/**
|
|
2839
4245
|
* Constructor is used for internal usage only, do not create object from it.
|
|
2840
4246
|
*/
|
|
2841
|
-
constructor(ctx, _id,
|
|
4247
|
+
constructor(ctx, _id, _hash, _name, _typeName) {
|
|
2842
4248
|
super(ctx);
|
|
2843
4249
|
this._id = _id;
|
|
2844
|
-
this.
|
|
4250
|
+
this._hash = _hash;
|
|
2845
4251
|
this._name = _name;
|
|
2846
|
-
this.
|
|
4252
|
+
this._typeName = _typeName;
|
|
2847
4253
|
}
|
|
2848
4254
|
/**
|
|
2849
|
-
* A unique identifier for this
|
|
4255
|
+
* A unique identifier for this LLMVariable.
|
|
2850
4256
|
*/
|
|
2851
4257
|
id = async () => {
|
|
2852
4258
|
if (this._id) {
|
|
@@ -2856,28 +4262,14 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2856
4262
|
const response = await ctx.execute();
|
|
2857
4263
|
return response;
|
|
2858
4264
|
};
|
|
2859
|
-
|
|
2860
|
-
|
|
2861
|
-
|
|
2862
|
-
description = async () => {
|
|
2863
|
-
if (this._description) {
|
|
2864
|
-
return this._description;
|
|
4265
|
+
hash = async () => {
|
|
4266
|
+
if (this._hash) {
|
|
4267
|
+
return this._hash;
|
|
2865
4268
|
}
|
|
2866
|
-
const ctx = this._ctx.select("
|
|
4269
|
+
const ctx = this._ctx.select("hash");
|
|
2867
4270
|
const response = await ctx.execute();
|
|
2868
4271
|
return response;
|
|
2869
4272
|
};
|
|
2870
|
-
/**
|
|
2871
|
-
* Functions defined on this interface, if any.
|
|
2872
|
-
*/
|
|
2873
|
-
functions = async () => {
|
|
2874
|
-
const ctx = this._ctx.select("functions").select("id");
|
|
2875
|
-
const response = await ctx.execute();
|
|
2876
|
-
return response.map((r) => new Client(ctx.copy()).loadFunctionFromID(r.id));
|
|
2877
|
-
};
|
|
2878
|
-
/**
|
|
2879
|
-
* The name of the interface.
|
|
2880
|
-
*/
|
|
2881
4273
|
name = async () => {
|
|
2882
4274
|
if (this._name) {
|
|
2883
4275
|
return this._name;
|
|
@@ -2886,21 +4278,11 @@ export class InterfaceTypeDef extends BaseClient {
|
|
|
2886
4278
|
const response = await ctx.execute();
|
|
2887
4279
|
return response;
|
|
2888
4280
|
};
|
|
2889
|
-
|
|
2890
|
-
|
|
2891
|
-
|
|
2892
|
-
sourceMap = () => {
|
|
2893
|
-
const ctx = this._ctx.select("sourceMap");
|
|
2894
|
-
return new SourceMap(ctx);
|
|
2895
|
-
};
|
|
2896
|
-
/**
|
|
2897
|
-
* If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
|
|
2898
|
-
*/
|
|
2899
|
-
sourceModuleName = async () => {
|
|
2900
|
-
if (this._sourceModuleName) {
|
|
2901
|
-
return this._sourceModuleName;
|
|
4281
|
+
typeName = async () => {
|
|
4282
|
+
if (this._typeName) {
|
|
4283
|
+
return this._typeName;
|
|
2902
4284
|
}
|
|
2903
|
-
const ctx = this._ctx.select("
|
|
4285
|
+
const ctx = this._ctx.select("typeName");
|
|
2904
4286
|
const response = await ctx.execute();
|
|
2905
4287
|
return response;
|
|
2906
4288
|
};
|
|
@@ -3313,7 +4695,7 @@ export class ModuleSource extends BaseClient {
|
|
|
3313
4695
|
return response;
|
|
3314
4696
|
};
|
|
3315
4697
|
/**
|
|
3316
|
-
* The resolved commit of the git repo this source points to.
|
|
4698
|
+
* The resolved commit of the git repo this source points to.
|
|
3317
4699
|
*/
|
|
3318
4700
|
commit = async () => {
|
|
3319
4701
|
if (this._commit) {
|
|
@@ -3395,7 +4777,7 @@ export class ModuleSource extends BaseClient {
|
|
|
3395
4777
|
return new Directory(ctx);
|
|
3396
4778
|
};
|
|
3397
4779
|
/**
|
|
3398
|
-
* The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
|
|
4780
|
+
* The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
|
|
3399
4781
|
*/
|
|
3400
4782
|
htmlRepoURL = async () => {
|
|
3401
4783
|
if (this._htmlRepoURL) {
|
|
@@ -3531,7 +4913,7 @@ export class ModuleSource extends BaseClient {
|
|
|
3531
4913
|
return new Client(ctx.copy()).loadModuleSourceFromID(response);
|
|
3532
4914
|
};
|
|
3533
4915
|
/**
|
|
3534
|
-
* The specified version of the git repo this source points to.
|
|
4916
|
+
* The specified version of the git repo this source points to.
|
|
3535
4917
|
*/
|
|
3536
4918
|
version = async () => {
|
|
3537
4919
|
if (this._version) {
|
|
@@ -3945,6 +5327,15 @@ export class Client extends BaseClient {
|
|
|
3945
5327
|
const ctx = this._ctx.select("http", { url, ...opts });
|
|
3946
5328
|
return new File(ctx);
|
|
3947
5329
|
};
|
|
5330
|
+
/**
|
|
5331
|
+
* Initialize a Large Language Model (LLM)
|
|
5332
|
+
* @param opts.model Model to use
|
|
5333
|
+
* @param opts.maxAPICalls Cap the number of API calls for this LLM
|
|
5334
|
+
*/
|
|
5335
|
+
llm = (opts) => {
|
|
5336
|
+
const ctx = this._ctx.select("llm", { ...opts });
|
|
5337
|
+
return new LLM(ctx);
|
|
5338
|
+
};
|
|
3948
5339
|
/**
|
|
3949
5340
|
* Load a CacheVolume from its ID.
|
|
3950
5341
|
*/
|
|
@@ -4029,6 +5420,13 @@ export class Client extends BaseClient {
|
|
|
4029
5420
|
const ctx = this._ctx.select("loadErrorFromID", { id });
|
|
4030
5421
|
return new Error(ctx);
|
|
4031
5422
|
};
|
|
5423
|
+
/**
|
|
5424
|
+
* Load a ErrorValue from its ID.
|
|
5425
|
+
*/
|
|
5426
|
+
loadErrorValueFromID = (id) => {
|
|
5427
|
+
const ctx = this._ctx.select("loadErrorValueFromID", { id });
|
|
5428
|
+
return new ErrorValue(ctx);
|
|
5429
|
+
};
|
|
4032
5430
|
/**
|
|
4033
5431
|
* Load a FieldTypeDef from its ID.
|
|
4034
5432
|
*/
|
|
@@ -4113,6 +5511,20 @@ export class Client extends BaseClient {
|
|
|
4113
5511
|
const ctx = this._ctx.select("loadInterfaceTypeDefFromID", { id });
|
|
4114
5512
|
return new InterfaceTypeDef(ctx);
|
|
4115
5513
|
};
|
|
5514
|
+
/**
|
|
5515
|
+
* Load a LLM from its ID.
|
|
5516
|
+
*/
|
|
5517
|
+
loadLLMFromID = (id) => {
|
|
5518
|
+
const ctx = this._ctx.select("loadLLMFromID", { id });
|
|
5519
|
+
return new LLM(ctx);
|
|
5520
|
+
};
|
|
5521
|
+
/**
|
|
5522
|
+
* Load a LLMVariable from its ID.
|
|
5523
|
+
*/
|
|
5524
|
+
loadLLMVariableFromID = (id) => {
|
|
5525
|
+
const ctx = this._ctx.select("loadLLMVariableFromID", { id });
|
|
5526
|
+
return new LLMVariable(ctx);
|
|
5527
|
+
};
|
|
4116
5528
|
/**
|
|
4117
5529
|
* Load a Label from its ID.
|
|
4118
5530
|
*/
|