@dagger.io/dagger 0.16.3 → 0.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -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,1673 @@ 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
+ _getString = undefined;
2983
+ _historyJSON = undefined;
2984
+ _lastReply = undefined;
2985
+ _model = undefined;
2986
+ _provider = undefined;
2987
+ _sync = undefined;
2988
+ _tools = undefined;
2989
+ /**
2990
+ * Constructor is used for internal usage only, do not create object from it.
2991
+ */
2992
+ constructor(ctx, _id, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
2993
+ super(ctx);
2994
+ this._id = _id;
2995
+ this._getString = _getString;
2996
+ this._historyJSON = _historyJSON;
2997
+ this._lastReply = _lastReply;
2998
+ this._model = _model;
2999
+ this._provider = _provider;
3000
+ this._sync = _sync;
3001
+ this._tools = _tools;
3002
+ }
3003
+ /**
3004
+ * A unique identifier for this LLM.
3005
+ */
3006
+ id = async () => {
3007
+ if (this._id) {
3008
+ return this._id;
3009
+ }
3010
+ const ctx = this._ctx.select("id");
3011
+ const response = await ctx.execute();
3012
+ return response;
3013
+ };
3014
+ /**
3015
+ * Retrieve a the current value in the LLM environment, of type CacheVolume
3016
+ * @deprecated use get<TargetType> instead
3017
+ */
3018
+ cacheVolume = () => {
3019
+ const ctx = this._ctx.select("cacheVolume");
3020
+ return new CacheVolume(ctx);
3021
+ };
3022
+ /**
3023
+ * Retrieve a the current value in the LLM environment, of type Container
3024
+ * @deprecated use get<TargetType> instead
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
+ * @deprecated use get<TargetType> instead
3033
+ */
3034
+ currentModule = () => {
3035
+ const ctx = this._ctx.select("currentModule");
3036
+ return new CurrentModule(ctx);
3037
+ };
3038
+ /**
3039
+ * Retrieve a the current value in the LLM environment, of type Directory
3040
+ * @deprecated use get<TargetType> instead
3041
+ */
3042
+ directory = () => {
3043
+ const ctx = this._ctx.select("directory");
3044
+ return new Directory(ctx);
3045
+ };
3046
+ /**
3047
+ * Retrieve a the current value in the LLM environment, of type EnumTypeDef
3048
+ * @deprecated use get<TargetType> instead
3049
+ */
3050
+ enumTypeDef = () => {
3051
+ const ctx = this._ctx.select("enumTypeDef");
3052
+ return new EnumTypeDef(ctx);
3053
+ };
3054
+ /**
3055
+ * Retrieve a the current value in the LLM environment, of type EnumValueTypeDef
3056
+ * @deprecated use get<TargetType> instead
3057
+ */
3058
+ enumValueTypeDef = () => {
3059
+ const ctx = this._ctx.select("enumValueTypeDef");
3060
+ return new EnumValueTypeDef(ctx);
3061
+ };
3062
+ /**
3063
+ * Retrieve a the current value in the LLM environment, of type Error
3064
+ * @deprecated use get<TargetType> instead
3065
+ */
3066
+ error = () => {
3067
+ const ctx = this._ctx.select("error");
3068
+ return new Error(ctx);
3069
+ };
3070
+ /**
3071
+ * Retrieve a the current value in the LLM environment, of type ErrorValue
3072
+ * @deprecated use get<TargetType> instead
3073
+ */
3074
+ errorValue = () => {
3075
+ const ctx = this._ctx.select("errorValue");
3076
+ return new ErrorValue(ctx);
3077
+ };
3078
+ /**
3079
+ * Retrieve a the current value in the LLM environment, of type FieldTypeDef
3080
+ * @deprecated use get<TargetType> instead
3081
+ */
3082
+ fieldTypeDef = () => {
3083
+ const ctx = this._ctx.select("fieldTypeDef");
3084
+ return new FieldTypeDef(ctx);
3085
+ };
3086
+ /**
3087
+ * Retrieve a the current value in the LLM environment, of type File
3088
+ * @deprecated use get<TargetType> instead
3089
+ */
3090
+ file = () => {
3091
+ const ctx = this._ctx.select("file");
3092
+ return new File(ctx);
3093
+ };
3094
+ /**
3095
+ * Retrieve a the current value in the LLM environment, of type Function
3096
+ * @deprecated use get<TargetType> instead
3097
+ */
3098
+ function_ = () => {
3099
+ const ctx = this._ctx.select("function");
3100
+ return new Function_(ctx);
3101
+ };
3102
+ /**
3103
+ * Retrieve a the current value in the LLM environment, of type FunctionArg
3104
+ * @deprecated use get<TargetType> instead
3105
+ */
3106
+ functionArg = () => {
3107
+ const ctx = this._ctx.select("functionArg");
3108
+ return new FunctionArg(ctx);
3109
+ };
3110
+ /**
3111
+ * Retrieve a the current value in the LLM environment, of type FunctionCall
3112
+ * @deprecated use get<TargetType> instead
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
+ * @deprecated use get<TargetType> instead
3121
+ */
3122
+ functionCallArgValue = () => {
3123
+ const ctx = this._ctx.select("functionCallArgValue");
3124
+ return new FunctionCallArgValue(ctx);
3125
+ };
3126
+ /**
3127
+ * Retrieve a the current value in the LLM environment, of type GeneratedCode
3128
+ * @deprecated use get<TargetType> instead
3129
+ */
3130
+ generatedCode = () => {
3131
+ const ctx = this._ctx.select("generatedCode");
3132
+ return new GeneratedCode(ctx);
3133
+ };
3134
+ /**
3135
+ * Retrieve a variable in the llm environment, of type CacheVolume
3136
+ * @param name The name of the variable
3137
+ */
3138
+ getCacheVolume = (name) => {
3139
+ const ctx = this._ctx.select("getCacheVolume", { name });
3140
+ return new CacheVolume(ctx);
3141
+ };
3142
+ /**
3143
+ * Retrieve a variable in the llm environment, of type Container
3144
+ * @param name The name of the variable
3145
+ */
3146
+ getContainer = (name) => {
3147
+ const ctx = this._ctx.select("getContainer", { name });
3148
+ return new Container(ctx);
3149
+ };
3150
+ /**
3151
+ * Retrieve a variable in the llm environment, of type CurrentModule
3152
+ * @param name The name of the variable
3153
+ */
3154
+ getCurrentModule = (name) => {
3155
+ const ctx = this._ctx.select("getCurrentModule", { name });
3156
+ return new CurrentModule(ctx);
3157
+ };
3158
+ /**
3159
+ * Retrieve a variable in the llm environment, of type Directory
3160
+ * @param name The name of the variable
3161
+ */
3162
+ getDirectory = (name) => {
3163
+ const ctx = this._ctx.select("getDirectory", { name });
3164
+ return new Directory(ctx);
3165
+ };
3166
+ /**
3167
+ * Retrieve a variable in the llm environment, of type EnumTypeDef
3168
+ * @param name The name of the variable
3169
+ */
3170
+ getEnumTypeDef = (name) => {
3171
+ const ctx = this._ctx.select("getEnumTypeDef", { name });
3172
+ return new EnumTypeDef(ctx);
3173
+ };
3174
+ /**
3175
+ * Retrieve a variable in the llm environment, of type EnumValueTypeDef
3176
+ * @param name The name of the variable
3177
+ */
3178
+ getEnumValueTypeDef = (name) => {
3179
+ const ctx = this._ctx.select("getEnumValueTypeDef", { name });
3180
+ return new EnumValueTypeDef(ctx);
3181
+ };
3182
+ /**
3183
+ * Retrieve a variable in the llm environment, of type Error
3184
+ * @param name The name of the variable
3185
+ */
3186
+ getError = (name) => {
3187
+ const ctx = this._ctx.select("getError", { name });
3188
+ return new Error(ctx);
3189
+ };
3190
+ /**
3191
+ * Retrieve a variable in the llm environment, of type ErrorValue
3192
+ * @param name The name of the variable
3193
+ */
3194
+ getErrorValue = (name) => {
3195
+ const ctx = this._ctx.select("getErrorValue", { name });
3196
+ return new ErrorValue(ctx);
3197
+ };
3198
+ /**
3199
+ * Retrieve a variable in the llm environment, of type FieldTypeDef
3200
+ * @param name The name of the variable
3201
+ */
3202
+ getFieldTypeDef = (name) => {
3203
+ const ctx = this._ctx.select("getFieldTypeDef", { name });
3204
+ return new FieldTypeDef(ctx);
3205
+ };
3206
+ /**
3207
+ * Retrieve a variable in the llm environment, of type File
3208
+ * @param name The name of the variable
3209
+ */
3210
+ getFile = (name) => {
3211
+ const ctx = this._ctx.select("getFile", { name });
3212
+ return new File(ctx);
3213
+ };
3214
+ /**
3215
+ * Retrieve a variable in the llm environment, of type Function
3216
+ * @param name The name of the variable
3217
+ */
3218
+ getFunction = (name) => {
3219
+ const ctx = this._ctx.select("getFunction", { name });
3220
+ return new Function_(ctx);
3221
+ };
3222
+ /**
3223
+ * Retrieve a variable in the llm environment, of type FunctionArg
3224
+ * @param name The name of the variable
3225
+ */
3226
+ getFunctionArg = (name) => {
3227
+ const ctx = this._ctx.select("getFunctionArg", { name });
3228
+ return new FunctionArg(ctx);
3229
+ };
3230
+ /**
3231
+ * Retrieve a variable in the llm environment, of type FunctionCall
3232
+ * @param name The name of the variable
3233
+ */
3234
+ getFunctionCall = (name) => {
3235
+ const ctx = this._ctx.select("getFunctionCall", { name });
3236
+ return new FunctionCall(ctx);
3237
+ };
3238
+ /**
3239
+ * Retrieve a variable in the llm environment, of type FunctionCallArgValue
3240
+ * @param name The name of the variable
3241
+ */
3242
+ getFunctionCallArgValue = (name) => {
3243
+ const ctx = this._ctx.select("getFunctionCallArgValue", { name });
3244
+ return new FunctionCallArgValue(ctx);
3245
+ };
3246
+ /**
3247
+ * Retrieve a variable in the llm environment, of type GeneratedCode
3248
+ * @param name The name of the variable
3249
+ */
3250
+ getGeneratedCode = (name) => {
3251
+ const ctx = this._ctx.select("getGeneratedCode", { name });
3252
+ return new GeneratedCode(ctx);
3253
+ };
3254
+ /**
3255
+ * Retrieve a variable in the llm environment, of type GitRef
3256
+ * @param name The name of the variable
3257
+ */
3258
+ getGitRef = (name) => {
3259
+ const ctx = this._ctx.select("getGitRef", { name });
3260
+ return new GitRef(ctx);
3261
+ };
3262
+ /**
3263
+ * Retrieve a variable in the llm environment, of type GitRepository
3264
+ * @param name The name of the variable
3265
+ */
3266
+ getGitRepository = (name) => {
3267
+ const ctx = this._ctx.select("getGitRepository", { name });
3268
+ return new GitRepository(ctx);
3269
+ };
3270
+ /**
3271
+ * Retrieve a variable in the llm environment, of type InputTypeDef
3272
+ * @param name The name of the variable
3273
+ */
3274
+ getInputTypeDef = (name) => {
3275
+ const ctx = this._ctx.select("getInputTypeDef", { name });
3276
+ return new InputTypeDef(ctx);
3277
+ };
3278
+ /**
3279
+ * Retrieve a variable in the llm environment, of type InterfaceTypeDef
3280
+ * @param name The name of the variable
3281
+ */
3282
+ getInterfaceTypeDef = (name) => {
3283
+ const ctx = this._ctx.select("getInterfaceTypeDef", { name });
3284
+ return new InterfaceTypeDef(ctx);
3285
+ };
3286
+ /**
3287
+ * Retrieve a variable in the llm environment, of type LLM
3288
+ * @param name The name of the variable
3289
+ */
3290
+ getLLM = (name) => {
3291
+ const ctx = this._ctx.select("getLLM", { name });
3292
+ return new LLM(ctx);
3293
+ };
3294
+ /**
3295
+ * Retrieve a variable in the llm environment, of type ListTypeDef
3296
+ * @param name The name of the variable
3297
+ */
3298
+ getListTypeDef = (name) => {
3299
+ const ctx = this._ctx.select("getListTypeDef", { name });
3300
+ return new ListTypeDef(ctx);
3301
+ };
3302
+ /**
3303
+ * Retrieve a variable in the llm environment, of type Module
3304
+ * @param name The name of the variable
3305
+ */
3306
+ getModule = (name) => {
3307
+ const ctx = this._ctx.select("getModule", { name });
3308
+ return new Module_(ctx);
3309
+ };
3310
+ /**
3311
+ * Retrieve a variable in the llm environment, of type ModuleConfigClient
3312
+ * @param name The name of the variable
3313
+ */
3314
+ getModuleConfigClient = (name) => {
3315
+ const ctx = this._ctx.select("getModuleConfigClient", { name });
3316
+ return new ModuleConfigClient(ctx);
3317
+ };
3318
+ /**
3319
+ * Retrieve a variable in the llm environment, of type ModuleSource
3320
+ * @param name The name of the variable
3321
+ */
3322
+ getModuleSource = (name) => {
3323
+ const ctx = this._ctx.select("getModuleSource", { name });
3324
+ return new ModuleSource(ctx);
3325
+ };
3326
+ /**
3327
+ * Retrieve a variable in the llm environment, of type ObjectTypeDef
3328
+ * @param name The name of the variable
3329
+ */
3330
+ getObjectTypeDef = (name) => {
3331
+ const ctx = this._ctx.select("getObjectTypeDef", { name });
3332
+ return new ObjectTypeDef(ctx);
3333
+ };
3334
+ /**
3335
+ * Retrieve a variable in the llm environment, of type SDKConfig
3336
+ * @param name The name of the variable
3337
+ */
3338
+ getSDKConfig = (name) => {
3339
+ const ctx = this._ctx.select("getSDKConfig", { name });
3340
+ return new SDKConfig(ctx);
3341
+ };
3342
+ /**
3343
+ * Retrieve a variable in the llm environment, of type ScalarTypeDef
3344
+ * @param name The name of the variable
3345
+ */
3346
+ getScalarTypeDef = (name) => {
3347
+ const ctx = this._ctx.select("getScalarTypeDef", { name });
3348
+ return new ScalarTypeDef(ctx);
3349
+ };
3350
+ /**
3351
+ * Retrieve a variable in the llm environment, of type Secret
3352
+ * @param name The name of the variable
3353
+ */
3354
+ getSecret = (name) => {
3355
+ const ctx = this._ctx.select("getSecret", { name });
3356
+ return new Secret(ctx);
3357
+ };
3358
+ /**
3359
+ * Retrieve a variable in the llm environment, of type Service
3360
+ * @param name The name of the variable
3361
+ */
3362
+ getService = (name) => {
3363
+ const ctx = this._ctx.select("getService", { name });
3364
+ return new Service(ctx);
3365
+ };
3366
+ /**
3367
+ * Retrieve a variable in the llm environment, of type Socket
3368
+ * @param name The name of the variable
3369
+ */
3370
+ getSocket = (name) => {
3371
+ const ctx = this._ctx.select("getSocket", { name });
3372
+ return new Socket(ctx);
3373
+ };
3374
+ /**
3375
+ * Retrieve a variable in the llm environment, of type SourceMap
3376
+ * @param name The name of the variable
3377
+ */
3378
+ getSourceMap = (name) => {
3379
+ const ctx = this._ctx.select("getSourceMap", { name });
3380
+ return new SourceMap(ctx);
3381
+ };
3382
+ /**
3383
+ * Get a string variable from the LLM's environment
3384
+ * @param name The variable name
3385
+ */
3386
+ getString = async (name) => {
3387
+ if (this._getString) {
3388
+ return this._getString;
3389
+ }
3390
+ const ctx = this._ctx.select("getString", { name });
3391
+ const response = await ctx.execute();
3392
+ return response;
3393
+ };
3394
+ /**
3395
+ * Retrieve a variable in the llm environment, of type Terminal
3396
+ * @param name The name of the variable
3397
+ */
3398
+ getTerminal = (name) => {
3399
+ const ctx = this._ctx.select("getTerminal", { name });
3400
+ return new Terminal(ctx);
3401
+ };
3402
+ /**
3403
+ * Retrieve a variable in the llm environment, of type TypeDef
3404
+ * @param name The name of the variable
3405
+ */
3406
+ getTypeDef = (name) => {
3407
+ const ctx = this._ctx.select("getTypeDef", { name });
3408
+ return new TypeDef(ctx);
3409
+ };
3410
+ /**
3411
+ * Retrieve a the current value in the LLM environment, of type GitRef
3412
+ * @deprecated use get<TargetType> instead
3413
+ */
3414
+ gitRef = () => {
3415
+ const ctx = this._ctx.select("gitRef");
3416
+ return new GitRef(ctx);
3417
+ };
3418
+ /**
3419
+ * Retrieve a the current value in the LLM environment, of type GitRepository
3420
+ * @deprecated use get<TargetType> instead
3421
+ */
3422
+ gitRepository = () => {
3423
+ const ctx = this._ctx.select("gitRepository");
3424
+ return new GitRepository(ctx);
3425
+ };
3426
+ /**
3427
+ * return the llm message history
3428
+ */
3429
+ history = async () => {
3430
+ const ctx = this._ctx.select("history");
3431
+ const response = await ctx.execute();
3432
+ return response;
3433
+ };
3434
+ /**
3435
+ * return the raw llm message history as json
3436
+ */
3437
+ historyJSON = async () => {
3438
+ if (this._historyJSON) {
3439
+ return this._historyJSON;
3440
+ }
3441
+ const ctx = this._ctx.select("historyJSON");
3442
+ const response = await ctx.execute();
3443
+ return response;
3444
+ };
3445
+ /**
3446
+ * Retrieve a the current value in the LLM environment, of type InputTypeDef
3447
+ * @deprecated use get<TargetType> instead
3448
+ */
3449
+ inputTypeDef = () => {
3450
+ const ctx = this._ctx.select("inputTypeDef");
3451
+ return new InputTypeDef(ctx);
3452
+ };
3453
+ /**
3454
+ * Retrieve a the current value in the LLM environment, of type InterfaceTypeDef
3455
+ * @deprecated use get<TargetType> instead
3456
+ */
3457
+ interfaceTypeDef = () => {
3458
+ const ctx = this._ctx.select("interfaceTypeDef");
3459
+ return new InterfaceTypeDef(ctx);
3460
+ };
3461
+ /**
3462
+ * Retrieve a the current value in the LLM environment, of type LLM
3463
+ * @deprecated use get<TargetType> instead
3464
+ */
3465
+ lLM = () => {
3466
+ const ctx = this._ctx.select("lLM");
3467
+ return new LLM(ctx);
3468
+ };
3469
+ /**
3470
+ * return the last llm reply from the history
3471
+ */
3472
+ lastReply = async () => {
3473
+ if (this._lastReply) {
3474
+ return this._lastReply;
3475
+ }
3476
+ const ctx = this._ctx.select("lastReply");
3477
+ const response = await ctx.execute();
3478
+ return response;
3479
+ };
3480
+ /**
3481
+ * Retrieve a the current value in the LLM environment, of type ListTypeDef
3482
+ * @deprecated use get<TargetType> instead
3483
+ */
3484
+ listTypeDef = () => {
3485
+ const ctx = this._ctx.select("listTypeDef");
3486
+ return new ListTypeDef(ctx);
3487
+ };
3488
+ /**
3489
+ * synchronize LLM state
3490
+ * @deprecated use sync
3491
+ */
3492
+ loop = () => {
3493
+ const ctx = this._ctx.select("loop");
3494
+ return new LLM(ctx);
3495
+ };
3496
+ /**
3497
+ * return the model used by the llm
3498
+ */
3499
+ model = async () => {
3500
+ if (this._model) {
3501
+ return this._model;
3502
+ }
3503
+ const ctx = this._ctx.select("model");
3504
+ const response = await ctx.execute();
3505
+ return response;
3506
+ };
3507
+ /**
3508
+ * Retrieve a the current value in the LLM environment, of type Module
3509
+ * @deprecated use get<TargetType> instead
3510
+ */
3511
+ module_ = () => {
3512
+ const ctx = this._ctx.select("module");
3513
+ return new Module_(ctx);
3514
+ };
3515
+ /**
3516
+ * Retrieve a the current value in the LLM environment, of type ModuleConfigClient
3517
+ * @deprecated use get<TargetType> instead
3518
+ */
3519
+ moduleConfigClient = () => {
3520
+ const ctx = this._ctx.select("moduleConfigClient");
3521
+ return new ModuleConfigClient(ctx);
3522
+ };
3523
+ /**
3524
+ * Retrieve a the current value in the LLM environment, of type ModuleSource
3525
+ * @deprecated use get<TargetType> instead
3526
+ */
3527
+ moduleSource = () => {
3528
+ const ctx = this._ctx.select("moduleSource");
3529
+ return new ModuleSource(ctx);
3530
+ };
3531
+ /**
3532
+ * Retrieve a the current value in the LLM environment, of type ObjectTypeDef
3533
+ * @deprecated use get<TargetType> instead
3534
+ */
3535
+ objectTypeDef = () => {
3536
+ const ctx = this._ctx.select("objectTypeDef");
3537
+ return new ObjectTypeDef(ctx);
3538
+ };
3539
+ /**
3540
+ * return the provider used by the llm
3541
+ */
3542
+ provider = async () => {
3543
+ if (this._provider) {
3544
+ return this._provider;
3545
+ }
3546
+ const ctx = this._ctx.select("provider");
3547
+ const response = await ctx.execute();
3548
+ return response;
3549
+ };
3550
+ /**
3551
+ * Retrieve a the current value in the LLM environment, of type ScalarTypeDef
3552
+ * @deprecated use get<TargetType> instead
3553
+ */
3554
+ scalarTypeDef = () => {
3555
+ const ctx = this._ctx.select("scalarTypeDef");
3556
+ return new ScalarTypeDef(ctx);
3557
+ };
3558
+ /**
3559
+ * Retrieve a the current value in the LLM environment, of type SDKConfig
3560
+ * @deprecated use get<TargetType> instead
3561
+ */
3562
+ sdkconfig = () => {
3563
+ const ctx = this._ctx.select("sdkconfig");
3564
+ return new SDKConfig(ctx);
3565
+ };
3566
+ /**
3567
+ * Retrieve a the current value in the LLM environment, of type Secret
3568
+ * @deprecated use get<TargetType> instead
3569
+ */
3570
+ secret = () => {
3571
+ const ctx = this._ctx.select("secret");
3572
+ return new Secret(ctx);
3573
+ };
3574
+ /**
3575
+ * Retrieve a the current value in the LLM environment, of type Service
3576
+ * @deprecated use get<TargetType> instead
3577
+ */
3578
+ service = () => {
3579
+ const ctx = this._ctx.select("service");
3580
+ return new Service(ctx);
3581
+ };
3582
+ /**
3583
+ * Set a variable of type CacheVolume in the llm environment
3584
+ * @param name The name of the variable
3585
+ * @param value The CacheVolume value to assign to the variable
3586
+ */
3587
+ setCacheVolume = (name, value) => {
3588
+ const ctx = this._ctx.select("setCacheVolume", { name, value });
3589
+ return new LLM(ctx);
3590
+ };
3591
+ /**
3592
+ * Set a variable of type Container in the llm environment
3593
+ * @param name The name of the variable
3594
+ * @param value The Container value to assign to the variable
3595
+ */
3596
+ setContainer = (name, value) => {
3597
+ const ctx = this._ctx.select("setContainer", { name, value });
3598
+ return new LLM(ctx);
3599
+ };
3600
+ /**
3601
+ * Set a variable of type CurrentModule in the llm environment
3602
+ * @param name The name of the variable
3603
+ * @param value The CurrentModule value to assign to the variable
3604
+ */
3605
+ setCurrentModule = (name, value) => {
3606
+ const ctx = this._ctx.select("setCurrentModule", { name, value });
3607
+ return new LLM(ctx);
3608
+ };
3609
+ /**
3610
+ * Set a variable of type Directory in the llm environment
3611
+ * @param name The name of the variable
3612
+ * @param value The Directory value to assign to the variable
3613
+ */
3614
+ setDirectory = (name, value) => {
3615
+ const ctx = this._ctx.select("setDirectory", { name, value });
3616
+ return new LLM(ctx);
3617
+ };
3618
+ /**
3619
+ * Set a variable of type EnumTypeDef in the llm environment
3620
+ * @param name The name of the variable
3621
+ * @param value The EnumTypeDef value to assign to the variable
3622
+ */
3623
+ setEnumTypeDef = (name, value) => {
3624
+ const ctx = this._ctx.select("setEnumTypeDef", { name, value });
3625
+ return new LLM(ctx);
3626
+ };
3627
+ /**
3628
+ * Set a variable of type EnumValueTypeDef in the llm environment
3629
+ * @param name The name of the variable
3630
+ * @param value The EnumValueTypeDef value to assign to the variable
3631
+ */
3632
+ setEnumValueTypeDef = (name, value) => {
3633
+ const ctx = this._ctx.select("setEnumValueTypeDef", { name, value });
3634
+ return new LLM(ctx);
3635
+ };
3636
+ /**
3637
+ * Set a variable of type Error in the llm environment
3638
+ * @param name The name of the variable
3639
+ * @param value The Error value to assign to the variable
3640
+ */
3641
+ setError = (name, value) => {
3642
+ const ctx = this._ctx.select("setError", { name, value });
3643
+ return new LLM(ctx);
3644
+ };
3645
+ /**
3646
+ * Set a variable of type ErrorValue in the llm environment
3647
+ * @param name The name of the variable
3648
+ * @param value The ErrorValue value to assign to the variable
3649
+ */
3650
+ setErrorValue = (name, value) => {
3651
+ const ctx = this._ctx.select("setErrorValue", { name, value });
3652
+ return new LLM(ctx);
3653
+ };
3654
+ /**
3655
+ * Set a variable of type FieldTypeDef in the llm environment
3656
+ * @param name The name of the variable
3657
+ * @param value The FieldTypeDef value to assign to the variable
3658
+ */
3659
+ setFieldTypeDef = (name, value) => {
3660
+ const ctx = this._ctx.select("setFieldTypeDef", { name, value });
3661
+ return new LLM(ctx);
3662
+ };
3663
+ /**
3664
+ * Set a variable of type File in the llm environment
3665
+ * @param name The name of the variable
3666
+ * @param value The File value to assign to the variable
3667
+ */
3668
+ setFile = (name, value) => {
3669
+ const ctx = this._ctx.select("setFile", { name, value });
3670
+ return new LLM(ctx);
3671
+ };
3672
+ /**
3673
+ * Set a variable of type Function in the llm environment
3674
+ * @param name The name of the variable
3675
+ * @param value The Function value to assign to the variable
3676
+ */
3677
+ setFunction = (name, value) => {
3678
+ const ctx = this._ctx.select("setFunction", { name, value });
3679
+ return new LLM(ctx);
3680
+ };
3681
+ /**
3682
+ * Set a variable of type FunctionArg in the llm environment
3683
+ * @param name The name of the variable
3684
+ * @param value The FunctionArg value to assign to the variable
3685
+ */
3686
+ setFunctionArg = (name, value) => {
3687
+ const ctx = this._ctx.select("setFunctionArg", { name, value });
3688
+ return new LLM(ctx);
3689
+ };
3690
+ /**
3691
+ * Set a variable of type FunctionCall in the llm environment
3692
+ * @param name The name of the variable
3693
+ * @param value The FunctionCall value to assign to the variable
3694
+ */
3695
+ setFunctionCall = (name, value) => {
3696
+ const ctx = this._ctx.select("setFunctionCall", { name, value });
3697
+ return new LLM(ctx);
3698
+ };
3699
+ /**
3700
+ * Set a variable of type FunctionCallArgValue in the llm environment
3701
+ * @param name The name of the variable
3702
+ * @param value The FunctionCallArgValue value to assign to the variable
3703
+ */
3704
+ setFunctionCallArgValue = (name, value) => {
3705
+ const ctx = this._ctx.select("setFunctionCallArgValue", { name, value });
3706
+ return new LLM(ctx);
3707
+ };
3708
+ /**
3709
+ * Set a variable of type GeneratedCode in the llm environment
3710
+ * @param name The name of the variable
3711
+ * @param value The GeneratedCode value to assign to the variable
3712
+ */
3713
+ setGeneratedCode = (name, value) => {
3714
+ const ctx = this._ctx.select("setGeneratedCode", { name, value });
3715
+ return new LLM(ctx);
3716
+ };
3717
+ /**
3718
+ * Set a variable of type GitRef in the llm environment
3719
+ * @param name The name of the variable
3720
+ * @param value The GitRef value to assign to the variable
3721
+ */
3722
+ setGitRef = (name, value) => {
3723
+ const ctx = this._ctx.select("setGitRef", { name, value });
3724
+ return new LLM(ctx);
3725
+ };
3726
+ /**
3727
+ * Set a variable of type GitRepository in the llm environment
3728
+ * @param name The name of the variable
3729
+ * @param value The GitRepository value to assign to the variable
3730
+ */
3731
+ setGitRepository = (name, value) => {
3732
+ const ctx = this._ctx.select("setGitRepository", { name, value });
3733
+ return new LLM(ctx);
3734
+ };
3735
+ /**
3736
+ * Set a variable of type InputTypeDef in the llm environment
3737
+ * @param name The name of the variable
3738
+ * @param value The InputTypeDef value to assign to the variable
3739
+ */
3740
+ setInputTypeDef = (name, value) => {
3741
+ const ctx = this._ctx.select("setInputTypeDef", { name, value });
3742
+ return new LLM(ctx);
3743
+ };
3744
+ /**
3745
+ * Set a variable of type InterfaceTypeDef in the llm environment
3746
+ * @param name The name of the variable
3747
+ * @param value The InterfaceTypeDef value to assign to the variable
3748
+ */
3749
+ setInterfaceTypeDef = (name, value) => {
3750
+ const ctx = this._ctx.select("setInterfaceTypeDef", { name, value });
3751
+ return new LLM(ctx);
3752
+ };
3753
+ /**
3754
+ * Set a variable of type LLM in the llm environment
3755
+ * @param name The name of the variable
3756
+ * @param value The LLM value to assign to the variable
3757
+ */
3758
+ setLLM = (name, value) => {
3759
+ const ctx = this._ctx.select("setLLM", { name, value });
3760
+ return new LLM(ctx);
3761
+ };
3762
+ /**
3763
+ * Set a variable of type ListTypeDef in the llm environment
3764
+ * @param name The name of the variable
3765
+ * @param value The ListTypeDef value to assign to the variable
3766
+ */
3767
+ setListTypeDef = (name, value) => {
3768
+ const ctx = this._ctx.select("setListTypeDef", { name, value });
3769
+ return new LLM(ctx);
3770
+ };
3771
+ /**
3772
+ * Set a variable of type Module in the llm environment
3773
+ * @param name The name of the variable
3774
+ * @param value The Module value to assign to the variable
3775
+ */
3776
+ setModule = (name, value) => {
3777
+ const ctx = this._ctx.select("setModule", { name, value });
3778
+ return new LLM(ctx);
3779
+ };
3780
+ /**
3781
+ * Set a variable of type ModuleConfigClient in the llm environment
3782
+ * @param name The name of the variable
3783
+ * @param value The ModuleConfigClient value to assign to the variable
3784
+ */
3785
+ setModuleConfigClient = (name, value) => {
3786
+ const ctx = this._ctx.select("setModuleConfigClient", { name, value });
3787
+ return new LLM(ctx);
3788
+ };
3789
+ /**
3790
+ * Set a variable of type ModuleSource in the llm environment
3791
+ * @param name The name of the variable
3792
+ * @param value The ModuleSource value to assign to the variable
3793
+ */
3794
+ setModuleSource = (name, value) => {
3795
+ const ctx = this._ctx.select("setModuleSource", { name, value });
3796
+ return new LLM(ctx);
3797
+ };
3798
+ /**
3799
+ * Set a variable of type ObjectTypeDef in the llm environment
3800
+ * @param name The name of the variable
3801
+ * @param value The ObjectTypeDef value to assign to the variable
3802
+ */
3803
+ setObjectTypeDef = (name, value) => {
3804
+ const ctx = this._ctx.select("setObjectTypeDef", { name, value });
3805
+ return new LLM(ctx);
3806
+ };
3807
+ /**
3808
+ * Set a variable of type SDKConfig in the llm environment
3809
+ * @param name The name of the variable
3810
+ * @param value The SDKConfig value to assign to the variable
3811
+ */
3812
+ setSDKConfig = (name, value) => {
3813
+ const ctx = this._ctx.select("setSDKConfig", { name, value });
3814
+ return new LLM(ctx);
3815
+ };
3816
+ /**
3817
+ * Set a variable of type ScalarTypeDef in the llm environment
3818
+ * @param name The name of the variable
3819
+ * @param value The ScalarTypeDef value to assign to the variable
3820
+ */
3821
+ setScalarTypeDef = (name, value) => {
3822
+ const ctx = this._ctx.select("setScalarTypeDef", { name, value });
3823
+ return new LLM(ctx);
3824
+ };
3825
+ /**
3826
+ * Set a variable of type Secret in the llm environment
3827
+ * @param name The name of the variable
3828
+ * @param value The Secret value to assign to the variable
3829
+ */
3830
+ setSecret = (name, value) => {
3831
+ const ctx = this._ctx.select("setSecret", { name, value });
3832
+ return new LLM(ctx);
3833
+ };
3834
+ /**
3835
+ * Set a variable of type Service in the llm environment
3836
+ * @param name The name of the variable
3837
+ * @param value The Service value to assign to the variable
3838
+ */
3839
+ setService = (name, value) => {
3840
+ const ctx = this._ctx.select("setService", { name, value });
3841
+ return new LLM(ctx);
3842
+ };
3843
+ /**
3844
+ * Set a variable of type Socket in the llm environment
3845
+ * @param name The name of the variable
3846
+ * @param value The Socket value to assign to the variable
3847
+ */
3848
+ setSocket = (name, value) => {
3849
+ const ctx = this._ctx.select("setSocket", { name, value });
3850
+ return new LLM(ctx);
3851
+ };
3852
+ /**
3853
+ * Set a variable of type SourceMap in the llm environment
3854
+ * @param name The name of the variable
3855
+ * @param value The SourceMap value to assign to the variable
3856
+ */
3857
+ setSourceMap = (name, value) => {
3858
+ const ctx = this._ctx.select("setSourceMap", { name, value });
3859
+ return new LLM(ctx);
3860
+ };
3861
+ /**
3862
+ * Add a string variable to the LLM's environment
3863
+ * @param name The variable name
3864
+ * @param value The variable value
3865
+ */
3866
+ setString = (name, value) => {
3867
+ const ctx = this._ctx.select("setString", { name, value });
3868
+ return new LLM(ctx);
3869
+ };
3870
+ /**
3871
+ * Set a variable of type Terminal in the llm environment
3872
+ * @param name The name of the variable
3873
+ * @param value The Terminal value to assign to the variable
3874
+ */
3875
+ setTerminal = (name, value) => {
3876
+ const ctx = this._ctx.select("setTerminal", { name, value });
3877
+ return new LLM(ctx);
3878
+ };
3879
+ /**
3880
+ * Set a variable of type TypeDef in the llm environment
3881
+ * @param name The name of the variable
3882
+ * @param value The TypeDef value to assign to the variable
3883
+ */
3884
+ setTypeDef = (name, value) => {
3885
+ const ctx = this._ctx.select("setTypeDef", { name, value });
3886
+ return new LLM(ctx);
3887
+ };
3888
+ /**
3889
+ * Retrieve a the current value in the LLM environment, of type Socket
3890
+ * @deprecated use get<TargetType> instead
3891
+ */
3892
+ socket = () => {
3893
+ const ctx = this._ctx.select("socket");
3894
+ return new Socket(ctx);
3895
+ };
3896
+ /**
3897
+ * Retrieve a the current value in the LLM environment, of type SourceMap
3898
+ * @deprecated use get<TargetType> instead
3899
+ */
3900
+ sourceMap = () => {
3901
+ const ctx = this._ctx.select("sourceMap");
3902
+ return new SourceMap(ctx);
3903
+ };
3904
+ /**
3905
+ * synchronize LLM state
3906
+ */
3907
+ sync = async () => {
3908
+ const ctx = this._ctx.select("sync");
3909
+ const response = await ctx.execute();
3910
+ return new Client(ctx.copy()).loadLLMFromID(response);
3911
+ };
3912
+ /**
3913
+ * Retrieve a the current value in the LLM environment, of type Terminal
3914
+ * @deprecated use get<TargetType> instead
3915
+ */
3916
+ terminal = () => {
3917
+ const ctx = this._ctx.select("terminal");
3918
+ return new Terminal(ctx);
3919
+ };
3920
+ /**
3921
+ * print documentation for available tools
3922
+ */
3923
+ tools = async () => {
3924
+ if (this._tools) {
3925
+ return this._tools;
3926
+ }
3927
+ const ctx = this._ctx.select("tools");
3928
+ const response = await ctx.execute();
3929
+ return response;
3930
+ };
3931
+ /**
3932
+ * Retrieve a the current value in the LLM environment, of type TypeDef
3933
+ * @deprecated use get<TargetType> instead
3934
+ */
3935
+ typeDef = () => {
3936
+ const ctx = this._ctx.select("typeDef");
3937
+ return new TypeDef(ctx);
3938
+ };
3939
+ /**
3940
+ * list variables in the LLM environment
3941
+ */
3942
+ variables = async () => {
3943
+ const ctx = this._ctx.select("variables").select("id");
3944
+ const response = await ctx.execute();
3945
+ return response.map((r) => new Client(ctx.copy()).loadLLMVariableFromID(r.id));
3946
+ };
3947
+ /**
3948
+ * Set a variable of type CacheVolume in the llm environment
3949
+ * @param value The CacheVolume value to assign to the variable
3950
+ * @deprecated use set<TargetType> instead
3951
+ */
3952
+ withCacheVolume = (value) => {
3953
+ const ctx = this._ctx.select("withCacheVolume", { value });
3954
+ return new LLM(ctx);
3955
+ };
3956
+ /**
3957
+ * Set a variable of type Container in the llm environment
3958
+ * @param value The Container value to assign to the variable
3959
+ * @deprecated use set<TargetType> instead
3960
+ */
3961
+ withContainer = (value) => {
3962
+ const ctx = this._ctx.select("withContainer", { value });
3963
+ return new LLM(ctx);
3964
+ };
3965
+ /**
3966
+ * Set a variable of type CurrentModule in the llm environment
3967
+ * @param value The CurrentModule value to assign to the variable
3968
+ * @deprecated use set<TargetType> instead
3969
+ */
3970
+ withCurrentModule = (value) => {
3971
+ const ctx = this._ctx.select("withCurrentModule", { value });
3972
+ return new LLM(ctx);
3973
+ };
3974
+ /**
3975
+ * Set a variable of type Directory in the llm environment
3976
+ * @param value The Directory value to assign to the variable
3977
+ * @deprecated use set<TargetType> instead
3978
+ */
3979
+ withDirectory = (value) => {
3980
+ const ctx = this._ctx.select("withDirectory", { value });
3981
+ return new LLM(ctx);
3982
+ };
3983
+ /**
3984
+ * Set a variable of type EnumTypeDef in the llm environment
3985
+ * @param value The EnumTypeDef value to assign to the variable
3986
+ * @deprecated use set<TargetType> instead
3987
+ */
3988
+ withEnumTypeDef = (value) => {
3989
+ const ctx = this._ctx.select("withEnumTypeDef", { value });
3990
+ return new LLM(ctx);
3991
+ };
3992
+ /**
3993
+ * Set a variable of type EnumValueTypeDef in the llm environment
3994
+ * @param value The EnumValueTypeDef value to assign to the variable
3995
+ * @deprecated use set<TargetType> instead
3996
+ */
3997
+ withEnumValueTypeDef = (value) => {
3998
+ const ctx = this._ctx.select("withEnumValueTypeDef", { value });
3999
+ return new LLM(ctx);
4000
+ };
4001
+ /**
4002
+ * Set a variable of type Error in the llm environment
4003
+ * @param value The Error value to assign to the variable
4004
+ * @deprecated use set<TargetType> instead
4005
+ */
4006
+ withError = (value) => {
4007
+ const ctx = this._ctx.select("withError", { value });
4008
+ return new LLM(ctx);
4009
+ };
4010
+ /**
4011
+ * Set a variable of type ErrorValue in the llm environment
4012
+ * @param value The ErrorValue value to assign to the variable
4013
+ * @deprecated use set<TargetType> instead
4014
+ */
4015
+ withErrorValue = (value) => {
4016
+ const ctx = this._ctx.select("withErrorValue", { value });
4017
+ return new LLM(ctx);
4018
+ };
4019
+ /**
4020
+ * Set a variable of type FieldTypeDef in the llm environment
4021
+ * @param value The FieldTypeDef value to assign to the variable
4022
+ * @deprecated use set<TargetType> instead
4023
+ */
4024
+ withFieldTypeDef = (value) => {
4025
+ const ctx = this._ctx.select("withFieldTypeDef", { value });
4026
+ return new LLM(ctx);
4027
+ };
4028
+ /**
4029
+ * Set a variable of type File in the llm environment
4030
+ * @param value The File value to assign to the variable
4031
+ * @deprecated use set<TargetType> instead
4032
+ */
4033
+ withFile = (value) => {
4034
+ const ctx = this._ctx.select("withFile", { value });
4035
+ return new LLM(ctx);
4036
+ };
4037
+ /**
4038
+ * Set a variable of type Function in the llm environment
4039
+ * @param value The Function value to assign to the variable
4040
+ * @deprecated use set<TargetType> instead
4041
+ */
4042
+ withFunction = (value) => {
4043
+ const ctx = this._ctx.select("withFunction", { value });
4044
+ return new LLM(ctx);
4045
+ };
4046
+ /**
4047
+ * Set a variable of type FunctionArg in the llm environment
4048
+ * @param value The FunctionArg value to assign to the variable
4049
+ * @deprecated use set<TargetType> instead
2565
4050
  */
2566
- id = async () => {
2567
- if (this._id) {
2568
- return this._id;
2569
- }
2570
- const ctx = this._ctx.select("id");
2571
- const response = await ctx.execute();
2572
- return response;
4051
+ withFunctionArg = (value) => {
4052
+ const ctx = this._ctx.select("withFunctionArg", { value });
4053
+ return new LLM(ctx);
2573
4054
  };
2574
4055
  /**
2575
- * The resolved commit id at this ref.
4056
+ * Set a variable of type FunctionCall in the llm environment
4057
+ * @param value The FunctionCall value to assign to the variable
4058
+ * @deprecated use set<TargetType> instead
2576
4059
  */
2577
- commit = async () => {
2578
- if (this._commit) {
2579
- return this._commit;
2580
- }
2581
- const ctx = this._ctx.select("commit");
2582
- const response = await ctx.execute();
2583
- return response;
4060
+ withFunctionCall = (value) => {
4061
+ const ctx = this._ctx.select("withFunctionCall", { value });
4062
+ return new LLM(ctx);
2584
4063
  };
2585
4064
  /**
2586
- * The filesystem tree at this ref.
2587
- * @param opts.discardGitDir Set to true to discard .git directory.
4065
+ * Set a variable of type FunctionCallArgValue in the llm environment
4066
+ * @param value The FunctionCallArgValue value to assign to the variable
4067
+ * @deprecated use set<TargetType> instead
2588
4068
  */
2589
- tree = (opts) => {
2590
- const ctx = this._ctx.select("tree", { ...opts });
2591
- return new Directory(ctx);
4069
+ withFunctionCallArgValue = (value) => {
4070
+ const ctx = this._ctx.select("withFunctionCallArgValue", { value });
4071
+ return new LLM(ctx);
2592
4072
  };
2593
- }
2594
- /**
2595
- * A git repository.
2596
- */
2597
- export class GitRepository extends BaseClient {
2598
- _id = undefined;
2599
4073
  /**
2600
- * Constructor is used for internal usage only, do not create object from it.
4074
+ * Set a variable of type GeneratedCode in the llm environment
4075
+ * @param value The GeneratedCode value to assign to the variable
4076
+ * @deprecated use set<TargetType> instead
2601
4077
  */
2602
- constructor(ctx, _id) {
2603
- super(ctx);
2604
- this._id = _id;
2605
- }
4078
+ withGeneratedCode = (value) => {
4079
+ const ctx = this._ctx.select("withGeneratedCode", { value });
4080
+ return new LLM(ctx);
4081
+ };
2606
4082
  /**
2607
- * A unique identifier for this GitRepository.
4083
+ * Set a variable of type GitRef in the llm environment
4084
+ * @param value The GitRef value to assign to the variable
4085
+ * @deprecated use set<TargetType> instead
2608
4086
  */
2609
- id = async () => {
2610
- if (this._id) {
2611
- return this._id;
2612
- }
2613
- const ctx = this._ctx.select("id");
2614
- const response = await ctx.execute();
2615
- return response;
4087
+ withGitRef = (value) => {
4088
+ const ctx = this._ctx.select("withGitRef", { value });
4089
+ return new LLM(ctx);
2616
4090
  };
2617
4091
  /**
2618
- * Returns details of a branch.
2619
- * @param name Branch's name (e.g., "main").
4092
+ * Set a variable of type GitRepository in the llm environment
4093
+ * @param value The GitRepository value to assign to the variable
4094
+ * @deprecated use set<TargetType> instead
2620
4095
  */
2621
- branch = (name) => {
2622
- const ctx = this._ctx.select("branch", { name });
2623
- return new GitRef(ctx);
4096
+ withGitRepository = (value) => {
4097
+ const ctx = this._ctx.select("withGitRepository", { value });
4098
+ return new LLM(ctx);
2624
4099
  };
2625
4100
  /**
2626
- * Returns details of a commit.
2627
- * @param id Identifier of the commit (e.g., "b6315d8f2810962c601af73f86831f6866ea798b").
4101
+ * Set a variable of type InputTypeDef in the llm environment
4102
+ * @param value The InputTypeDef value to assign to the variable
4103
+ * @deprecated use set<TargetType> instead
2628
4104
  */
2629
- commit = (id) => {
2630
- const ctx = this._ctx.select("commit", { id });
2631
- return new GitRef(ctx);
4105
+ withInputTypeDef = (value) => {
4106
+ const ctx = this._ctx.select("withInputTypeDef", { value });
4107
+ return new LLM(ctx);
2632
4108
  };
2633
4109
  /**
2634
- * Returns details for HEAD.
4110
+ * Set a variable of type InterfaceTypeDef in the llm environment
4111
+ * @param value The InterfaceTypeDef value to assign to the variable
4112
+ * @deprecated use set<TargetType> instead
2635
4113
  */
2636
- head = () => {
2637
- const ctx = this._ctx.select("head");
2638
- return new GitRef(ctx);
4114
+ withInterfaceTypeDef = (value) => {
4115
+ const ctx = this._ctx.select("withInterfaceTypeDef", { value });
4116
+ return new LLM(ctx);
2639
4117
  };
2640
4118
  /**
2641
- * Returns details of a ref.
2642
- * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
4119
+ * Set a variable of type LLM in the llm environment
4120
+ * @param value The LLM value to assign to the variable
4121
+ * @deprecated use set<TargetType> instead
2643
4122
  */
2644
- ref = (name) => {
2645
- const ctx = this._ctx.select("ref", { name });
2646
- return new GitRef(ctx);
4123
+ withLLM = (value) => {
4124
+ const ctx = this._ctx.select("withLLM", { value });
4125
+ return new LLM(ctx);
2647
4126
  };
2648
4127
  /**
2649
- * Returns details of a tag.
2650
- * @param name Tag's name (e.g., "v0.3.9").
4128
+ * Set a variable of type ListTypeDef in the llm environment
4129
+ * @param value The ListTypeDef value to assign to the variable
4130
+ * @deprecated use set<TargetType> instead
2651
4131
  */
2652
- tag = (name) => {
2653
- const ctx = this._ctx.select("tag", { name });
2654
- return new GitRef(ctx);
4132
+ withListTypeDef = (value) => {
4133
+ const ctx = this._ctx.select("withListTypeDef", { value });
4134
+ return new LLM(ctx);
2655
4135
  };
2656
4136
  /**
2657
- * tags that match any of the given glob patterns.
2658
- * @param opts.patterns Glob patterns (e.g., "refs/tags/v*").
4137
+ * swap out the llm model
4138
+ * @param model The model to use
2659
4139
  */
2660
- tags = async (opts) => {
2661
- const ctx = this._ctx.select("tags", { ...opts });
2662
- const response = await ctx.execute();
2663
- return response;
4140
+ withModel = (model) => {
4141
+ const ctx = this._ctx.select("withModel", { model });
4142
+ return new LLM(ctx);
2664
4143
  };
2665
4144
  /**
2666
- * Header to authenticate the remote with.
2667
- * @param header Secret used to populate the Authorization HTTP header
4145
+ * Set a variable of type Module in the llm environment
4146
+ * @param value The Module value to assign to the variable
4147
+ * @deprecated use set<TargetType> instead
2668
4148
  */
2669
- withAuthHeader = (header) => {
2670
- const ctx = this._ctx.select("withAuthHeader", { header });
2671
- return new GitRepository(ctx);
4149
+ withModule = (value) => {
4150
+ const ctx = this._ctx.select("withModule", { value });
4151
+ return new LLM(ctx);
2672
4152
  };
2673
4153
  /**
2674
- * Token to authenticate the remote with.
2675
- * @param token Secret used to populate the password during basic HTTP Authorization
4154
+ * Set a variable of type ModuleConfigClient in the llm environment
4155
+ * @param value The ModuleConfigClient value to assign to the variable
4156
+ * @deprecated use set<TargetType> instead
2676
4157
  */
2677
- withAuthToken = (token) => {
2678
- const ctx = this._ctx.select("withAuthToken", { token });
2679
- return new GitRepository(ctx);
4158
+ withModuleConfigClient = (value) => {
4159
+ const ctx = this._ctx.select("withModuleConfigClient", { value });
4160
+ return new LLM(ctx);
2680
4161
  };
2681
4162
  /**
2682
- * Call the provided function with current GitRepository.
2683
- *
2684
- * This is useful for reusability and readability by not breaking the calling chain.
4163
+ * Set a variable of type ModuleSource in the llm environment
4164
+ * @param value The ModuleSource value to assign to the variable
4165
+ * @deprecated use set<TargetType> instead
2685
4166
  */
2686
- with = (arg) => {
2687
- return arg(this);
4167
+ withModuleSource = (value) => {
4168
+ const ctx = this._ctx.select("withModuleSource", { value });
4169
+ return new LLM(ctx);
2688
4170
  };
2689
- }
2690
- /**
2691
- * Information about the host environment.
2692
- */
2693
- export class Host extends BaseClient {
2694
- _id = undefined;
2695
4171
  /**
2696
- * Constructor is used for internal usage only, do not create object from it.
4172
+ * Set a variable of type ObjectTypeDef in the llm environment
4173
+ * @param value The ObjectTypeDef value to assign to the variable
4174
+ * @deprecated use set<TargetType> instead
2697
4175
  */
2698
- constructor(ctx, _id) {
2699
- super(ctx);
2700
- this._id = _id;
2701
- }
4176
+ withObjectTypeDef = (value) => {
4177
+ const ctx = this._ctx.select("withObjectTypeDef", { value });
4178
+ return new LLM(ctx);
4179
+ };
2702
4180
  /**
2703
- * A unique identifier for this Host.
4181
+ * append a prompt to the llm context
4182
+ * @param prompt The prompt to send
2704
4183
  */
2705
- id = async () => {
2706
- if (this._id) {
2707
- return this._id;
2708
- }
2709
- const ctx = this._ctx.select("id");
2710
- const response = await ctx.execute();
2711
- return response;
4184
+ withPrompt = (prompt) => {
4185
+ const ctx = this._ctx.select("withPrompt", { prompt });
4186
+ return new LLM(ctx);
2712
4187
  };
2713
4188
  /**
2714
- * Accesses a directory on the host.
2715
- * @param path Location of the directory to access (e.g., ".").
2716
- * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
2717
- * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
4189
+ * append the contents of a file to the llm context
4190
+ * @param file The file to read the prompt from
2718
4191
  */
2719
- directory = (path, opts) => {
2720
- const ctx = this._ctx.select("directory", { path, ...opts });
2721
- return new Directory(ctx);
4192
+ withPromptFile = (file) => {
4193
+ const ctx = this._ctx.select("withPromptFile", { file });
4194
+ return new LLM(ctx);
2722
4195
  };
2723
4196
  /**
2724
- * Accesses a file on the host.
2725
- * @param path Location of the file to retrieve (e.g., "README.md").
4197
+ * Add a string variable to the LLM's environment
4198
+ * @param name The variable name
4199
+ * @param value The variable value
2726
4200
  */
2727
- file = (path) => {
2728
- const ctx = this._ctx.select("file", { path });
2729
- return new File(ctx);
4201
+ withPromptVar = (name, value) => {
4202
+ const ctx = this._ctx.select("withPromptVar", { name, value });
4203
+ return new LLM(ctx);
2730
4204
  };
2731
4205
  /**
2732
- * Creates a service that forwards traffic to a specified address via the host.
2733
- * @param opts.host Upstream host to forward traffic to.
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.
4206
+ * Set a variable of type SDKConfig in the llm environment
4207
+ * @param value The SDKConfig value to assign to the variable
4208
+ * @deprecated use set<TargetType> instead
2739
4209
  */
2740
- service = (opts) => {
2741
- const ctx = this._ctx.select("service", { ...opts });
2742
- return new Service(ctx);
4210
+ withSDKConfig = (value) => {
4211
+ const ctx = this._ctx.select("withSDKConfig", { value });
4212
+ return new LLM(ctx);
2743
4213
  };
2744
4214
  /**
2745
- * Sets a secret given a user-defined name and the file path on the host, and returns the secret.
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.
4215
+ * Set a variable of type ScalarTypeDef in the llm environment
4216
+ * @param value The ScalarTypeDef value to assign to the variable
4217
+ * @deprecated use set<TargetType> instead
2750
4218
  */
2751
- setSecretFile = (name, path) => {
2752
- const ctx = this._ctx.select("setSecretFile", { name, path });
2753
- return new Secret(ctx);
4219
+ withScalarTypeDef = (value) => {
4220
+ const ctx = this._ctx.select("withScalarTypeDef", { value });
4221
+ return new LLM(ctx);
2754
4222
  };
2755
4223
  /**
2756
- * Creates a tunnel that forwards traffic from the host to a service.
2757
- * @param service Service to send traffic from the tunnel.
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.
4224
+ * Set a variable of type Secret in the llm environment
4225
+ * @param value The Secret value to assign to the variable
4226
+ * @deprecated use set<TargetType> instead
2768
4227
  */
2769
- tunnel = (service, opts) => {
2770
- const ctx = this._ctx.select("tunnel", { service, ...opts });
2771
- return new Service(ctx);
4228
+ withSecret = (value) => {
4229
+ const ctx = this._ctx.select("withSecret", { value });
4230
+ return new LLM(ctx);
2772
4231
  };
2773
4232
  /**
2774
- * Accesses a Unix socket on the host.
2775
- * @param path Location of the Unix socket (e.g., "/var/run/docker.sock").
4233
+ * Set a variable of type Service in the llm environment
4234
+ * @param value The Service value to assign to the variable
4235
+ * @deprecated use set<TargetType> instead
2776
4236
  */
2777
- unixSocket = (path) => {
2778
- const ctx = this._ctx.select("unixSocket", { path });
2779
- return new Socket(ctx);
4237
+ withService = (value) => {
4238
+ const ctx = this._ctx.select("withService", { value });
4239
+ return new LLM(ctx);
2780
4240
  };
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
4241
  /**
2792
- * Constructor is used for internal usage only, do not create object from it.
4242
+ * Set a variable of type Socket in the llm environment
4243
+ * @param value The Socket value to assign to the variable
4244
+ * @deprecated use set<TargetType> instead
2793
4245
  */
2794
- constructor(ctx, _id, _name) {
2795
- super(ctx);
2796
- this._id = _id;
2797
- this._name = _name;
2798
- }
4246
+ withSocket = (value) => {
4247
+ const ctx = this._ctx.select("withSocket", { value });
4248
+ return new LLM(ctx);
4249
+ };
2799
4250
  /**
2800
- * A unique identifier for this InputTypeDef.
4251
+ * Set a variable of type SourceMap in the llm environment
4252
+ * @param value The SourceMap value to assign to the variable
4253
+ * @deprecated use set<TargetType> instead
2801
4254
  */
2802
- id = async () => {
2803
- if (this._id) {
2804
- return this._id;
2805
- }
2806
- const ctx = this._ctx.select("id");
2807
- const response = await ctx.execute();
2808
- return response;
4255
+ withSourceMap = (value) => {
4256
+ const ctx = this._ctx.select("withSourceMap", { value });
4257
+ return new LLM(ctx);
2809
4258
  };
2810
4259
  /**
2811
- * Static fields defined on this input object, if any.
4260
+ * Set a variable of type Terminal in the llm environment
4261
+ * @param value The Terminal value to assign to the variable
4262
+ * @deprecated use set<TargetType> instead
2812
4263
  */
2813
- fields = async () => {
2814
- const ctx = this._ctx.select("fields").select("id");
2815
- const response = await ctx.execute();
2816
- return response.map((r) => new Client(ctx.copy()).loadFieldTypeDefFromID(r.id));
4264
+ withTerminal = (value) => {
4265
+ const ctx = this._ctx.select("withTerminal", { value });
4266
+ return new LLM(ctx);
2817
4267
  };
2818
4268
  /**
2819
- * The name of the input object.
4269
+ * Set a variable of type TypeDef in the llm environment
4270
+ * @param value The TypeDef value to assign to the variable
4271
+ * @deprecated use set<TargetType> instead
2820
4272
  */
2821
- name = async () => {
2822
- if (this._name) {
2823
- return this._name;
2824
- }
2825
- const ctx = this._ctx.select("name");
2826
- const response = await ctx.execute();
2827
- return response;
4273
+ withTypeDef = (value) => {
4274
+ const ctx = this._ctx.select("withTypeDef", { value });
4275
+ return new LLM(ctx);
4276
+ };
4277
+ /**
4278
+ * Call the provided function with current LLM.
4279
+ *
4280
+ * This is useful for reusability and readability by not breaking the calling chain.
4281
+ */
4282
+ with = (arg) => {
4283
+ return arg(this);
2828
4284
  };
2829
4285
  }
2830
- /**
2831
- * A definition of a custom interface defined in a Module.
2832
- */
2833
- export class InterfaceTypeDef extends BaseClient {
4286
+ export class LLMVariable extends BaseClient {
2834
4287
  _id = undefined;
2835
- _description = undefined;
4288
+ _hash = undefined;
2836
4289
  _name = undefined;
2837
- _sourceModuleName = undefined;
4290
+ _typeName = undefined;
2838
4291
  /**
2839
4292
  * Constructor is used for internal usage only, do not create object from it.
2840
4293
  */
2841
- constructor(ctx, _id, _description, _name, _sourceModuleName) {
4294
+ constructor(ctx, _id, _hash, _name, _typeName) {
2842
4295
  super(ctx);
2843
4296
  this._id = _id;
2844
- this._description = _description;
4297
+ this._hash = _hash;
2845
4298
  this._name = _name;
2846
- this._sourceModuleName = _sourceModuleName;
4299
+ this._typeName = _typeName;
2847
4300
  }
2848
4301
  /**
2849
- * A unique identifier for this InterfaceTypeDef.
4302
+ * A unique identifier for this LLMVariable.
2850
4303
  */
2851
4304
  id = async () => {
2852
4305
  if (this._id) {
@@ -2856,28 +4309,14 @@ export class InterfaceTypeDef extends BaseClient {
2856
4309
  const response = await ctx.execute();
2857
4310
  return response;
2858
4311
  };
2859
- /**
2860
- * The doc string for the interface, if any.
2861
- */
2862
- description = async () => {
2863
- if (this._description) {
2864
- return this._description;
4312
+ hash = async () => {
4313
+ if (this._hash) {
4314
+ return this._hash;
2865
4315
  }
2866
- const ctx = this._ctx.select("description");
4316
+ const ctx = this._ctx.select("hash");
2867
4317
  const response = await ctx.execute();
2868
4318
  return response;
2869
4319
  };
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
4320
  name = async () => {
2882
4321
  if (this._name) {
2883
4322
  return this._name;
@@ -2886,21 +4325,11 @@ export class InterfaceTypeDef extends BaseClient {
2886
4325
  const response = await ctx.execute();
2887
4326
  return response;
2888
4327
  };
2889
- /**
2890
- * The location of this interface declaration.
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;
4328
+ typeName = async () => {
4329
+ if (this._typeName) {
4330
+ return this._typeName;
2902
4331
  }
2903
- const ctx = this._ctx.select("sourceModuleName");
4332
+ const ctx = this._ctx.select("typeName");
2904
4333
  const response = await ctx.execute();
2905
4334
  return response;
2906
4335
  };
@@ -3945,6 +5374,15 @@ export class Client extends BaseClient {
3945
5374
  const ctx = this._ctx.select("http", { url, ...opts });
3946
5375
  return new File(ctx);
3947
5376
  };
5377
+ /**
5378
+ * Initialize a Large Language Model (LLM)
5379
+ * @param opts.model Model to use
5380
+ * @param opts.maxAPICalls Cap the number of API calls for this LLM
5381
+ */
5382
+ llm = (opts) => {
5383
+ const ctx = this._ctx.select("llm", { ...opts });
5384
+ return new LLM(ctx);
5385
+ };
3948
5386
  /**
3949
5387
  * Load a CacheVolume from its ID.
3950
5388
  */
@@ -4029,6 +5467,13 @@ export class Client extends BaseClient {
4029
5467
  const ctx = this._ctx.select("loadErrorFromID", { id });
4030
5468
  return new Error(ctx);
4031
5469
  };
5470
+ /**
5471
+ * Load a ErrorValue from its ID.
5472
+ */
5473
+ loadErrorValueFromID = (id) => {
5474
+ const ctx = this._ctx.select("loadErrorValueFromID", { id });
5475
+ return new ErrorValue(ctx);
5476
+ };
4032
5477
  /**
4033
5478
  * Load a FieldTypeDef from its ID.
4034
5479
  */
@@ -4113,6 +5558,20 @@ export class Client extends BaseClient {
4113
5558
  const ctx = this._ctx.select("loadInterfaceTypeDefFromID", { id });
4114
5559
  return new InterfaceTypeDef(ctx);
4115
5560
  };
5561
+ /**
5562
+ * Load a LLM from its ID.
5563
+ */
5564
+ loadLLMFromID = (id) => {
5565
+ const ctx = this._ctx.select("loadLLMFromID", { id });
5566
+ return new LLM(ctx);
5567
+ };
5568
+ /**
5569
+ * Load a LLMVariable from its ID.
5570
+ */
5571
+ loadLLMVariableFromID = (id) => {
5572
+ const ctx = this._ctx.select("loadLLMVariableFromID", { id });
5573
+ return new LLMVariable(ctx);
5574
+ };
4116
5575
  /**
4117
5576
  * Load a Label from its ID.
4118
5577
  */