@dagger.io/dagger 0.17.0 → 0.17.2

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.
@@ -1301,6 +1301,15 @@ export class Directory extends BaseClient {
1301
1301
  const ctx = this._ctx.select("file", { path });
1302
1302
  return new File(ctx);
1303
1303
  };
1304
+ /**
1305
+ * Retrieves this directory as per exclude/include filters.
1306
+ * @param opts.exclude Exclude artifacts that match the given pattern (e.g., ["node_modules/", ".git*"]).
1307
+ * @param opts.include Include only artifacts that match the given pattern (e.g., ["app/", "package.*"]).
1308
+ */
1309
+ filter = (opts) => {
1310
+ const ctx = this._ctx.select("filter", { ...opts });
1311
+ return new Directory(ctx);
1312
+ };
1304
1313
  /**
1305
1314
  * Returns a list of files and directories that matche the given pattern.
1306
1315
  * @param pattern Pattern to match (e.g., "*.md").
@@ -2979,6 +2988,7 @@ export class InterfaceTypeDef extends BaseClient {
2979
2988
  }
2980
2989
  export class LLM extends BaseClient {
2981
2990
  _id = undefined;
2991
+ _currentType = undefined;
2982
2992
  _getString = undefined;
2983
2993
  _historyJSON = undefined;
2984
2994
  _lastReply = undefined;
@@ -2989,9 +2999,10 @@ export class LLM extends BaseClient {
2989
2999
  /**
2990
3000
  * Constructor is used for internal usage only, do not create object from it.
2991
3001
  */
2992
- constructor(ctx, _id, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
3002
+ constructor(ctx, _id, _currentType, _getString, _historyJSON, _lastReply, _model, _provider, _sync, _tools) {
2993
3003
  super(ctx);
2994
3004
  this._id = _id;
3005
+ this._currentType = _currentType;
2995
3006
  this._getString = _getString;
2996
3007
  this._historyJSON = _historyJSON;
2997
3008
  this._lastReply = _lastReply;
@@ -3011,9 +3022,17 @@ export class LLM extends BaseClient {
3011
3022
  const response = await ctx.execute();
3012
3023
  return response;
3013
3024
  };
3025
+ /**
3026
+ * create a branch in the LLM's history
3027
+ */
3028
+ attempt = (number_) => {
3029
+ const ctx = this._ctx.select("attempt", {
3030
+ number: number_,
3031
+ });
3032
+ return new LLM(ctx);
3033
+ };
3014
3034
  /**
3015
3035
  * Retrieve a the current value in the LLM environment, of type CacheVolume
3016
- * @deprecated use get<TargetType> instead
3017
3036
  */
3018
3037
  cacheVolume = () => {
3019
3038
  const ctx = this._ctx.select("cacheVolume");
@@ -3021,7 +3040,6 @@ export class LLM extends BaseClient {
3021
3040
  };
3022
3041
  /**
3023
3042
  * Retrieve a the current value in the LLM environment, of type Container
3024
- * @deprecated use get<TargetType> instead
3025
3043
  */
3026
3044
  container = () => {
3027
3045
  const ctx = this._ctx.select("container");
@@ -3029,15 +3047,24 @@ export class LLM extends BaseClient {
3029
3047
  };
3030
3048
  /**
3031
3049
  * Retrieve a the current value in the LLM environment, of type CurrentModule
3032
- * @deprecated use get<TargetType> instead
3033
3050
  */
3034
3051
  currentModule = () => {
3035
3052
  const ctx = this._ctx.select("currentModule");
3036
3053
  return new CurrentModule(ctx);
3037
3054
  };
3055
+ /**
3056
+ * returns the type of the current state
3057
+ */
3058
+ currentType = async () => {
3059
+ if (this._currentType) {
3060
+ return this._currentType;
3061
+ }
3062
+ const ctx = this._ctx.select("currentType");
3063
+ const response = await ctx.execute();
3064
+ return response;
3065
+ };
3038
3066
  /**
3039
3067
  * Retrieve a the current value in the LLM environment, of type Directory
3040
- * @deprecated use get<TargetType> instead
3041
3068
  */
3042
3069
  directory = () => {
3043
3070
  const ctx = this._ctx.select("directory");
@@ -3045,7 +3072,6 @@ export class LLM extends BaseClient {
3045
3072
  };
3046
3073
  /**
3047
3074
  * Retrieve a the current value in the LLM environment, of type EnumTypeDef
3048
- * @deprecated use get<TargetType> instead
3049
3075
  */
3050
3076
  enumTypeDef = () => {
3051
3077
  const ctx = this._ctx.select("enumTypeDef");
@@ -3053,7 +3079,6 @@ export class LLM extends BaseClient {
3053
3079
  };
3054
3080
  /**
3055
3081
  * Retrieve a the current value in the LLM environment, of type EnumValueTypeDef
3056
- * @deprecated use get<TargetType> instead
3057
3082
  */
3058
3083
  enumValueTypeDef = () => {
3059
3084
  const ctx = this._ctx.select("enumValueTypeDef");
@@ -3061,7 +3086,6 @@ export class LLM extends BaseClient {
3061
3086
  };
3062
3087
  /**
3063
3088
  * Retrieve a the current value in the LLM environment, of type Error
3064
- * @deprecated use get<TargetType> instead
3065
3089
  */
3066
3090
  error = () => {
3067
3091
  const ctx = this._ctx.select("error");
@@ -3069,7 +3093,6 @@ export class LLM extends BaseClient {
3069
3093
  };
3070
3094
  /**
3071
3095
  * Retrieve a the current value in the LLM environment, of type ErrorValue
3072
- * @deprecated use get<TargetType> instead
3073
3096
  */
3074
3097
  errorValue = () => {
3075
3098
  const ctx = this._ctx.select("errorValue");
@@ -3077,7 +3100,6 @@ export class LLM extends BaseClient {
3077
3100
  };
3078
3101
  /**
3079
3102
  * Retrieve a the current value in the LLM environment, of type FieldTypeDef
3080
- * @deprecated use get<TargetType> instead
3081
3103
  */
3082
3104
  fieldTypeDef = () => {
3083
3105
  const ctx = this._ctx.select("fieldTypeDef");
@@ -3085,7 +3107,6 @@ export class LLM extends BaseClient {
3085
3107
  };
3086
3108
  /**
3087
3109
  * Retrieve a the current value in the LLM environment, of type File
3088
- * @deprecated use get<TargetType> instead
3089
3110
  */
3090
3111
  file = () => {
3091
3112
  const ctx = this._ctx.select("file");
@@ -3093,7 +3114,6 @@ export class LLM extends BaseClient {
3093
3114
  };
3094
3115
  /**
3095
3116
  * Retrieve a the current value in the LLM environment, of type Function
3096
- * @deprecated use get<TargetType> instead
3097
3117
  */
3098
3118
  function_ = () => {
3099
3119
  const ctx = this._ctx.select("function");
@@ -3101,7 +3121,6 @@ export class LLM extends BaseClient {
3101
3121
  };
3102
3122
  /**
3103
3123
  * Retrieve a the current value in the LLM environment, of type FunctionArg
3104
- * @deprecated use get<TargetType> instead
3105
3124
  */
3106
3125
  functionArg = () => {
3107
3126
  const ctx = this._ctx.select("functionArg");
@@ -3109,7 +3128,6 @@ export class LLM extends BaseClient {
3109
3128
  };
3110
3129
  /**
3111
3130
  * Retrieve a the current value in the LLM environment, of type FunctionCall
3112
- * @deprecated use get<TargetType> instead
3113
3131
  */
3114
3132
  functionCall = () => {
3115
3133
  const ctx = this._ctx.select("functionCall");
@@ -3117,7 +3135,6 @@ export class LLM extends BaseClient {
3117
3135
  };
3118
3136
  /**
3119
3137
  * Retrieve a the current value in the LLM environment, of type FunctionCallArgValue
3120
- * @deprecated use get<TargetType> instead
3121
3138
  */
3122
3139
  functionCallArgValue = () => {
3123
3140
  const ctx = this._ctx.select("functionCallArgValue");
@@ -3125,7 +3142,6 @@ export class LLM extends BaseClient {
3125
3142
  };
3126
3143
  /**
3127
3144
  * Retrieve a the current value in the LLM environment, of type GeneratedCode
3128
- * @deprecated use get<TargetType> instead
3129
3145
  */
3130
3146
  generatedCode = () => {
3131
3147
  const ctx = this._ctx.select("generatedCode");
@@ -3409,7 +3425,6 @@ export class LLM extends BaseClient {
3409
3425
  };
3410
3426
  /**
3411
3427
  * Retrieve a the current value in the LLM environment, of type GitRef
3412
- * @deprecated use get<TargetType> instead
3413
3428
  */
3414
3429
  gitRef = () => {
3415
3430
  const ctx = this._ctx.select("gitRef");
@@ -3417,7 +3432,6 @@ export class LLM extends BaseClient {
3417
3432
  };
3418
3433
  /**
3419
3434
  * Retrieve a the current value in the LLM environment, of type GitRepository
3420
- * @deprecated use get<TargetType> instead
3421
3435
  */
3422
3436
  gitRepository = () => {
3423
3437
  const ctx = this._ctx.select("gitRepository");
@@ -3444,7 +3458,6 @@ export class LLM extends BaseClient {
3444
3458
  };
3445
3459
  /**
3446
3460
  * Retrieve a the current value in the LLM environment, of type InputTypeDef
3447
- * @deprecated use get<TargetType> instead
3448
3461
  */
3449
3462
  inputTypeDef = () => {
3450
3463
  const ctx = this._ctx.select("inputTypeDef");
@@ -3452,7 +3465,6 @@ export class LLM extends BaseClient {
3452
3465
  };
3453
3466
  /**
3454
3467
  * Retrieve a the current value in the LLM environment, of type InterfaceTypeDef
3455
- * @deprecated use get<TargetType> instead
3456
3468
  */
3457
3469
  interfaceTypeDef = () => {
3458
3470
  const ctx = this._ctx.select("interfaceTypeDef");
@@ -3460,7 +3472,6 @@ export class LLM extends BaseClient {
3460
3472
  };
3461
3473
  /**
3462
3474
  * Retrieve a the current value in the LLM environment, of type LLM
3463
- * @deprecated use get<TargetType> instead
3464
3475
  */
3465
3476
  lLM = () => {
3466
3477
  const ctx = this._ctx.select("lLM");
@@ -3479,7 +3490,6 @@ export class LLM extends BaseClient {
3479
3490
  };
3480
3491
  /**
3481
3492
  * Retrieve a the current value in the LLM environment, of type ListTypeDef
3482
- * @deprecated use get<TargetType> instead
3483
3493
  */
3484
3494
  listTypeDef = () => {
3485
3495
  const ctx = this._ctx.select("listTypeDef");
@@ -3487,7 +3497,6 @@ export class LLM extends BaseClient {
3487
3497
  };
3488
3498
  /**
3489
3499
  * synchronize LLM state
3490
- * @deprecated use sync
3491
3500
  */
3492
3501
  loop = () => {
3493
3502
  const ctx = this._ctx.select("loop");
@@ -3506,7 +3515,6 @@ export class LLM extends BaseClient {
3506
3515
  };
3507
3516
  /**
3508
3517
  * Retrieve a the current value in the LLM environment, of type Module
3509
- * @deprecated use get<TargetType> instead
3510
3518
  */
3511
3519
  module_ = () => {
3512
3520
  const ctx = this._ctx.select("module");
@@ -3514,7 +3522,6 @@ export class LLM extends BaseClient {
3514
3522
  };
3515
3523
  /**
3516
3524
  * Retrieve a the current value in the LLM environment, of type ModuleConfigClient
3517
- * @deprecated use get<TargetType> instead
3518
3525
  */
3519
3526
  moduleConfigClient = () => {
3520
3527
  const ctx = this._ctx.select("moduleConfigClient");
@@ -3522,7 +3529,6 @@ export class LLM extends BaseClient {
3522
3529
  };
3523
3530
  /**
3524
3531
  * Retrieve a the current value in the LLM environment, of type ModuleSource
3525
- * @deprecated use get<TargetType> instead
3526
3532
  */
3527
3533
  moduleSource = () => {
3528
3534
  const ctx = this._ctx.select("moduleSource");
@@ -3530,7 +3536,6 @@ export class LLM extends BaseClient {
3530
3536
  };
3531
3537
  /**
3532
3538
  * Retrieve a the current value in the LLM environment, of type ObjectTypeDef
3533
- * @deprecated use get<TargetType> instead
3534
3539
  */
3535
3540
  objectTypeDef = () => {
3536
3541
  const ctx = this._ctx.select("objectTypeDef");
@@ -3549,7 +3554,6 @@ export class LLM extends BaseClient {
3549
3554
  };
3550
3555
  /**
3551
3556
  * Retrieve a the current value in the LLM environment, of type ScalarTypeDef
3552
- * @deprecated use get<TargetType> instead
3553
3557
  */
3554
3558
  scalarTypeDef = () => {
3555
3559
  const ctx = this._ctx.select("scalarTypeDef");
@@ -3557,7 +3561,6 @@ export class LLM extends BaseClient {
3557
3561
  };
3558
3562
  /**
3559
3563
  * Retrieve a the current value in the LLM environment, of type SDKConfig
3560
- * @deprecated use get<TargetType> instead
3561
3564
  */
3562
3565
  sdkconfig = () => {
3563
3566
  const ctx = this._ctx.select("sdkconfig");
@@ -3565,7 +3568,6 @@ export class LLM extends BaseClient {
3565
3568
  };
3566
3569
  /**
3567
3570
  * Retrieve a the current value in the LLM environment, of type Secret
3568
- * @deprecated use get<TargetType> instead
3569
3571
  */
3570
3572
  secret = () => {
3571
3573
  const ctx = this._ctx.select("secret");
@@ -3573,7 +3575,6 @@ export class LLM extends BaseClient {
3573
3575
  };
3574
3576
  /**
3575
3577
  * Retrieve a the current value in the LLM environment, of type Service
3576
- * @deprecated use get<TargetType> instead
3577
3578
  */
3578
3579
  service = () => {
3579
3580
  const ctx = this._ctx.select("service");
@@ -3887,7 +3888,6 @@ export class LLM extends BaseClient {
3887
3888
  };
3888
3889
  /**
3889
3890
  * Retrieve a the current value in the LLM environment, of type Socket
3890
- * @deprecated use get<TargetType> instead
3891
3891
  */
3892
3892
  socket = () => {
3893
3893
  const ctx = this._ctx.select("socket");
@@ -3895,7 +3895,6 @@ export class LLM extends BaseClient {
3895
3895
  };
3896
3896
  /**
3897
3897
  * Retrieve a the current value in the LLM environment, of type SourceMap
3898
- * @deprecated use get<TargetType> instead
3899
3898
  */
3900
3899
  sourceMap = () => {
3901
3900
  const ctx = this._ctx.select("sourceMap");
@@ -3911,12 +3910,18 @@ export class LLM extends BaseClient {
3911
3910
  };
3912
3911
  /**
3913
3912
  * Retrieve a the current value in the LLM environment, of type Terminal
3914
- * @deprecated use get<TargetType> instead
3915
3913
  */
3916
3914
  terminal = () => {
3917
3915
  const ctx = this._ctx.select("terminal");
3918
3916
  return new Terminal(ctx);
3919
3917
  };
3918
+ /**
3919
+ * returns the token usage of the current state
3920
+ */
3921
+ tokenUsage = () => {
3922
+ const ctx = this._ctx.select("tokenUsage");
3923
+ return new LLMTokenUsage(ctx);
3924
+ };
3920
3925
  /**
3921
3926
  * print documentation for available tools
3922
3927
  */
@@ -3930,7 +3935,6 @@ export class LLM extends BaseClient {
3930
3935
  };
3931
3936
  /**
3932
3937
  * Retrieve a the current value in the LLM environment, of type TypeDef
3933
- * @deprecated use get<TargetType> instead
3934
3938
  */
3935
3939
  typeDef = () => {
3936
3940
  const ctx = this._ctx.select("typeDef");
@@ -3947,7 +3951,6 @@ export class LLM extends BaseClient {
3947
3951
  /**
3948
3952
  * Set a variable of type CacheVolume in the llm environment
3949
3953
  * @param value The CacheVolume value to assign to the variable
3950
- * @deprecated use set<TargetType> instead
3951
3954
  */
3952
3955
  withCacheVolume = (value) => {
3953
3956
  const ctx = this._ctx.select("withCacheVolume", { value });
@@ -3956,7 +3959,6 @@ export class LLM extends BaseClient {
3956
3959
  /**
3957
3960
  * Set a variable of type Container in the llm environment
3958
3961
  * @param value The Container value to assign to the variable
3959
- * @deprecated use set<TargetType> instead
3960
3962
  */
3961
3963
  withContainer = (value) => {
3962
3964
  const ctx = this._ctx.select("withContainer", { value });
@@ -3965,7 +3967,6 @@ export class LLM extends BaseClient {
3965
3967
  /**
3966
3968
  * Set a variable of type CurrentModule in the llm environment
3967
3969
  * @param value The CurrentModule value to assign to the variable
3968
- * @deprecated use set<TargetType> instead
3969
3970
  */
3970
3971
  withCurrentModule = (value) => {
3971
3972
  const ctx = this._ctx.select("withCurrentModule", { value });
@@ -3974,7 +3975,6 @@ export class LLM extends BaseClient {
3974
3975
  /**
3975
3976
  * Set a variable of type Directory in the llm environment
3976
3977
  * @param value The Directory value to assign to the variable
3977
- * @deprecated use set<TargetType> instead
3978
3978
  */
3979
3979
  withDirectory = (value) => {
3980
3980
  const ctx = this._ctx.select("withDirectory", { value });
@@ -3983,7 +3983,6 @@ export class LLM extends BaseClient {
3983
3983
  /**
3984
3984
  * Set a variable of type EnumTypeDef in the llm environment
3985
3985
  * @param value The EnumTypeDef value to assign to the variable
3986
- * @deprecated use set<TargetType> instead
3987
3986
  */
3988
3987
  withEnumTypeDef = (value) => {
3989
3988
  const ctx = this._ctx.select("withEnumTypeDef", { value });
@@ -3992,7 +3991,6 @@ export class LLM extends BaseClient {
3992
3991
  /**
3993
3992
  * Set a variable of type EnumValueTypeDef in the llm environment
3994
3993
  * @param value The EnumValueTypeDef value to assign to the variable
3995
- * @deprecated use set<TargetType> instead
3996
3994
  */
3997
3995
  withEnumValueTypeDef = (value) => {
3998
3996
  const ctx = this._ctx.select("withEnumValueTypeDef", { value });
@@ -4001,7 +3999,6 @@ export class LLM extends BaseClient {
4001
3999
  /**
4002
4000
  * Set a variable of type Error in the llm environment
4003
4001
  * @param value The Error value to assign to the variable
4004
- * @deprecated use set<TargetType> instead
4005
4002
  */
4006
4003
  withError = (value) => {
4007
4004
  const ctx = this._ctx.select("withError", { value });
@@ -4010,7 +4007,6 @@ export class LLM extends BaseClient {
4010
4007
  /**
4011
4008
  * Set a variable of type ErrorValue in the llm environment
4012
4009
  * @param value The ErrorValue value to assign to the variable
4013
- * @deprecated use set<TargetType> instead
4014
4010
  */
4015
4011
  withErrorValue = (value) => {
4016
4012
  const ctx = this._ctx.select("withErrorValue", { value });
@@ -4019,7 +4015,6 @@ export class LLM extends BaseClient {
4019
4015
  /**
4020
4016
  * Set a variable of type FieldTypeDef in the llm environment
4021
4017
  * @param value The FieldTypeDef value to assign to the variable
4022
- * @deprecated use set<TargetType> instead
4023
4018
  */
4024
4019
  withFieldTypeDef = (value) => {
4025
4020
  const ctx = this._ctx.select("withFieldTypeDef", { value });
@@ -4028,7 +4023,6 @@ export class LLM extends BaseClient {
4028
4023
  /**
4029
4024
  * Set a variable of type File in the llm environment
4030
4025
  * @param value The File value to assign to the variable
4031
- * @deprecated use set<TargetType> instead
4032
4026
  */
4033
4027
  withFile = (value) => {
4034
4028
  const ctx = this._ctx.select("withFile", { value });
@@ -4037,7 +4031,6 @@ export class LLM extends BaseClient {
4037
4031
  /**
4038
4032
  * Set a variable of type Function in the llm environment
4039
4033
  * @param value The Function value to assign to the variable
4040
- * @deprecated use set<TargetType> instead
4041
4034
  */
4042
4035
  withFunction = (value) => {
4043
4036
  const ctx = this._ctx.select("withFunction", { value });
@@ -4046,7 +4039,6 @@ export class LLM extends BaseClient {
4046
4039
  /**
4047
4040
  * Set a variable of type FunctionArg in the llm environment
4048
4041
  * @param value The FunctionArg value to assign to the variable
4049
- * @deprecated use set<TargetType> instead
4050
4042
  */
4051
4043
  withFunctionArg = (value) => {
4052
4044
  const ctx = this._ctx.select("withFunctionArg", { value });
@@ -4055,7 +4047,6 @@ export class LLM extends BaseClient {
4055
4047
  /**
4056
4048
  * Set a variable of type FunctionCall in the llm environment
4057
4049
  * @param value The FunctionCall value to assign to the variable
4058
- * @deprecated use set<TargetType> instead
4059
4050
  */
4060
4051
  withFunctionCall = (value) => {
4061
4052
  const ctx = this._ctx.select("withFunctionCall", { value });
@@ -4064,7 +4055,6 @@ export class LLM extends BaseClient {
4064
4055
  /**
4065
4056
  * Set a variable of type FunctionCallArgValue in the llm environment
4066
4057
  * @param value The FunctionCallArgValue value to assign to the variable
4067
- * @deprecated use set<TargetType> instead
4068
4058
  */
4069
4059
  withFunctionCallArgValue = (value) => {
4070
4060
  const ctx = this._ctx.select("withFunctionCallArgValue", { value });
@@ -4073,7 +4063,6 @@ export class LLM extends BaseClient {
4073
4063
  /**
4074
4064
  * Set a variable of type GeneratedCode in the llm environment
4075
4065
  * @param value The GeneratedCode value to assign to the variable
4076
- * @deprecated use set<TargetType> instead
4077
4066
  */
4078
4067
  withGeneratedCode = (value) => {
4079
4068
  const ctx = this._ctx.select("withGeneratedCode", { value });
@@ -4082,7 +4071,6 @@ export class LLM extends BaseClient {
4082
4071
  /**
4083
4072
  * Set a variable of type GitRef in the llm environment
4084
4073
  * @param value The GitRef value to assign to the variable
4085
- * @deprecated use set<TargetType> instead
4086
4074
  */
4087
4075
  withGitRef = (value) => {
4088
4076
  const ctx = this._ctx.select("withGitRef", { value });
@@ -4091,7 +4079,6 @@ export class LLM extends BaseClient {
4091
4079
  /**
4092
4080
  * Set a variable of type GitRepository in the llm environment
4093
4081
  * @param value The GitRepository value to assign to the variable
4094
- * @deprecated use set<TargetType> instead
4095
4082
  */
4096
4083
  withGitRepository = (value) => {
4097
4084
  const ctx = this._ctx.select("withGitRepository", { value });
@@ -4100,7 +4087,6 @@ export class LLM extends BaseClient {
4100
4087
  /**
4101
4088
  * Set a variable of type InputTypeDef in the llm environment
4102
4089
  * @param value The InputTypeDef value to assign to the variable
4103
- * @deprecated use set<TargetType> instead
4104
4090
  */
4105
4091
  withInputTypeDef = (value) => {
4106
4092
  const ctx = this._ctx.select("withInputTypeDef", { value });
@@ -4109,7 +4095,6 @@ export class LLM extends BaseClient {
4109
4095
  /**
4110
4096
  * Set a variable of type InterfaceTypeDef in the llm environment
4111
4097
  * @param value The InterfaceTypeDef value to assign to the variable
4112
- * @deprecated use set<TargetType> instead
4113
4098
  */
4114
4099
  withInterfaceTypeDef = (value) => {
4115
4100
  const ctx = this._ctx.select("withInterfaceTypeDef", { value });
@@ -4118,7 +4103,6 @@ export class LLM extends BaseClient {
4118
4103
  /**
4119
4104
  * Set a variable of type LLM in the llm environment
4120
4105
  * @param value The LLM value to assign to the variable
4121
- * @deprecated use set<TargetType> instead
4122
4106
  */
4123
4107
  withLLM = (value) => {
4124
4108
  const ctx = this._ctx.select("withLLM", { value });
@@ -4127,7 +4111,6 @@ export class LLM extends BaseClient {
4127
4111
  /**
4128
4112
  * Set a variable of type ListTypeDef in the llm environment
4129
4113
  * @param value The ListTypeDef value to assign to the variable
4130
- * @deprecated use set<TargetType> instead
4131
4114
  */
4132
4115
  withListTypeDef = (value) => {
4133
4116
  const ctx = this._ctx.select("withListTypeDef", { value });
@@ -4144,7 +4127,6 @@ export class LLM extends BaseClient {
4144
4127
  /**
4145
4128
  * Set a variable of type Module in the llm environment
4146
4129
  * @param value The Module value to assign to the variable
4147
- * @deprecated use set<TargetType> instead
4148
4130
  */
4149
4131
  withModule = (value) => {
4150
4132
  const ctx = this._ctx.select("withModule", { value });
@@ -4153,7 +4135,6 @@ export class LLM extends BaseClient {
4153
4135
  /**
4154
4136
  * Set a variable of type ModuleConfigClient in the llm environment
4155
4137
  * @param value The ModuleConfigClient value to assign to the variable
4156
- * @deprecated use set<TargetType> instead
4157
4138
  */
4158
4139
  withModuleConfigClient = (value) => {
4159
4140
  const ctx = this._ctx.select("withModuleConfigClient", { value });
@@ -4162,7 +4143,6 @@ export class LLM extends BaseClient {
4162
4143
  /**
4163
4144
  * Set a variable of type ModuleSource in the llm environment
4164
4145
  * @param value The ModuleSource value to assign to the variable
4165
- * @deprecated use set<TargetType> instead
4166
4146
  */
4167
4147
  withModuleSource = (value) => {
4168
4148
  const ctx = this._ctx.select("withModuleSource", { value });
@@ -4171,7 +4151,6 @@ export class LLM extends BaseClient {
4171
4151
  /**
4172
4152
  * Set a variable of type ObjectTypeDef in the llm environment
4173
4153
  * @param value The ObjectTypeDef value to assign to the variable
4174
- * @deprecated use set<TargetType> instead
4175
4154
  */
4176
4155
  withObjectTypeDef = (value) => {
4177
4156
  const ctx = this._ctx.select("withObjectTypeDef", { value });
@@ -4202,10 +4181,16 @@ export class LLM extends BaseClient {
4202
4181
  const ctx = this._ctx.select("withPromptVar", { name, value });
4203
4182
  return new LLM(ctx);
4204
4183
  };
4184
+ /**
4185
+ * Provide the entire Query object to the LLM
4186
+ */
4187
+ withQuery = () => {
4188
+ const ctx = this._ctx.select("withQuery");
4189
+ return new LLM(ctx);
4190
+ };
4205
4191
  /**
4206
4192
  * Set a variable of type SDKConfig in the llm environment
4207
4193
  * @param value The SDKConfig value to assign to the variable
4208
- * @deprecated use set<TargetType> instead
4209
4194
  */
4210
4195
  withSDKConfig = (value) => {
4211
4196
  const ctx = this._ctx.select("withSDKConfig", { value });
@@ -4214,7 +4199,6 @@ export class LLM extends BaseClient {
4214
4199
  /**
4215
4200
  * Set a variable of type ScalarTypeDef in the llm environment
4216
4201
  * @param value The ScalarTypeDef value to assign to the variable
4217
- * @deprecated use set<TargetType> instead
4218
4202
  */
4219
4203
  withScalarTypeDef = (value) => {
4220
4204
  const ctx = this._ctx.select("withScalarTypeDef", { value });
@@ -4223,7 +4207,6 @@ export class LLM extends BaseClient {
4223
4207
  /**
4224
4208
  * Set a variable of type Secret in the llm environment
4225
4209
  * @param value The Secret value to assign to the variable
4226
- * @deprecated use set<TargetType> instead
4227
4210
  */
4228
4211
  withSecret = (value) => {
4229
4212
  const ctx = this._ctx.select("withSecret", { value });
@@ -4232,7 +4215,6 @@ export class LLM extends BaseClient {
4232
4215
  /**
4233
4216
  * Set a variable of type Service in the llm environment
4234
4217
  * @param value The Service value to assign to the variable
4235
- * @deprecated use set<TargetType> instead
4236
4218
  */
4237
4219
  withService = (value) => {
4238
4220
  const ctx = this._ctx.select("withService", { value });
@@ -4241,7 +4223,6 @@ export class LLM extends BaseClient {
4241
4223
  /**
4242
4224
  * Set a variable of type Socket in the llm environment
4243
4225
  * @param value The Socket value to assign to the variable
4244
- * @deprecated use set<TargetType> instead
4245
4226
  */
4246
4227
  withSocket = (value) => {
4247
4228
  const ctx = this._ctx.select("withSocket", { value });
@@ -4250,16 +4231,22 @@ export class LLM extends BaseClient {
4250
4231
  /**
4251
4232
  * Set a variable of type SourceMap in the llm environment
4252
4233
  * @param value The SourceMap value to assign to the variable
4253
- * @deprecated use set<TargetType> instead
4254
4234
  */
4255
4235
  withSourceMap = (value) => {
4256
4236
  const ctx = this._ctx.select("withSourceMap", { value });
4257
4237
  return new LLM(ctx);
4258
4238
  };
4239
+ /**
4240
+ * Add a system prompt to the LLM's environment
4241
+ * @param prompt The system prompt to send
4242
+ */
4243
+ withSystemPrompt = (prompt) => {
4244
+ const ctx = this._ctx.select("withSystemPrompt", { prompt });
4245
+ return new LLM(ctx);
4246
+ };
4259
4247
  /**
4260
4248
  * Set a variable of type Terminal in the llm environment
4261
4249
  * @param value The Terminal value to assign to the variable
4262
- * @deprecated use set<TargetType> instead
4263
4250
  */
4264
4251
  withTerminal = (value) => {
4265
4252
  const ctx = this._ctx.select("withTerminal", { value });
@@ -4268,7 +4255,6 @@ export class LLM extends BaseClient {
4268
4255
  /**
4269
4256
  * Set a variable of type TypeDef in the llm environment
4270
4257
  * @param value The TypeDef value to assign to the variable
4271
- * @deprecated use set<TargetType> instead
4272
4258
  */
4273
4259
  withTypeDef = (value) => {
4274
4260
  const ctx = this._ctx.select("withTypeDef", { value });
@@ -4283,6 +4269,57 @@ export class LLM extends BaseClient {
4283
4269
  return arg(this);
4284
4270
  };
4285
4271
  }
4272
+ export class LLMTokenUsage extends BaseClient {
4273
+ _id = undefined;
4274
+ _inputTokens = undefined;
4275
+ _outputTokens = undefined;
4276
+ _totalTokens = undefined;
4277
+ /**
4278
+ * Constructor is used for internal usage only, do not create object from it.
4279
+ */
4280
+ constructor(ctx, _id, _inputTokens, _outputTokens, _totalTokens) {
4281
+ super(ctx);
4282
+ this._id = _id;
4283
+ this._inputTokens = _inputTokens;
4284
+ this._outputTokens = _outputTokens;
4285
+ this._totalTokens = _totalTokens;
4286
+ }
4287
+ /**
4288
+ * A unique identifier for this LLMTokenUsage.
4289
+ */
4290
+ id = async () => {
4291
+ if (this._id) {
4292
+ return this._id;
4293
+ }
4294
+ const ctx = this._ctx.select("id");
4295
+ const response = await ctx.execute();
4296
+ return response;
4297
+ };
4298
+ inputTokens = async () => {
4299
+ if (this._inputTokens) {
4300
+ return this._inputTokens;
4301
+ }
4302
+ const ctx = this._ctx.select("inputTokens");
4303
+ const response = await ctx.execute();
4304
+ return response;
4305
+ };
4306
+ outputTokens = async () => {
4307
+ if (this._outputTokens) {
4308
+ return this._outputTokens;
4309
+ }
4310
+ const ctx = this._ctx.select("outputTokens");
4311
+ const response = await ctx.execute();
4312
+ return response;
4313
+ };
4314
+ totalTokens = async () => {
4315
+ if (this._totalTokens) {
4316
+ return this._totalTokens;
4317
+ }
4318
+ const ctx = this._ctx.select("totalTokens");
4319
+ const response = await ctx.execute();
4320
+ return response;
4321
+ };
4322
+ }
4286
4323
  export class LLMVariable extends BaseClient {
4287
4324
  _id = undefined;
4288
4325
  _hash = undefined;
@@ -4742,7 +4779,7 @@ export class ModuleSource extends BaseClient {
4742
4779
  return response;
4743
4780
  };
4744
4781
  /**
4745
- * The resolved commit of the git repo this source points to. Only valid for git sources.
4782
+ * The resolved commit of the git repo this source points to.
4746
4783
  */
4747
4784
  commit = async () => {
4748
4785
  if (this._commit) {
@@ -4824,7 +4861,7 @@ export class ModuleSource extends BaseClient {
4824
4861
  return new Directory(ctx);
4825
4862
  };
4826
4863
  /**
4827
- * The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket). Only valid for git sources.
4864
+ * The URL to access the web view of the repository (e.g., GitHub, GitLab, Bitbucket).
4828
4865
  */
4829
4866
  htmlRepoURL = async () => {
4830
4867
  if (this._htmlRepoURL) {
@@ -4960,7 +4997,7 @@ export class ModuleSource extends BaseClient {
4960
4997
  return new Client(ctx.copy()).loadModuleSourceFromID(response);
4961
4998
  };
4962
4999
  /**
4963
- * The specified version of the git repo this source points to. Only valid for git sources.
5000
+ * The specified version of the git repo this source points to.
4964
5001
  */
4965
5002
  version = async () => {
4966
5003
  if (this._version) {
@@ -5246,14 +5283,6 @@ export class Client extends BaseClient {
5246
5283
  getGQLClient() {
5247
5284
  return this._ctx.getGQLClient();
5248
5285
  }
5249
- /**
5250
- * Retrieves a container builtin to the engine.
5251
- * @param digest Digest of the image manifest
5252
- */
5253
- builtinContainer = (digest) => {
5254
- const ctx = this._ctx.select("builtinContainer", { digest });
5255
- return new Container(ctx);
5256
- };
5257
5286
  /**
5258
5287
  * Constructs a cache volume for a given cache key.
5259
5288
  * @param key A string identifier to target this cache volume (e.g., "modules-cache").
@@ -5565,6 +5594,13 @@ export class Client extends BaseClient {
5565
5594
  const ctx = this._ctx.select("loadLLMFromID", { id });
5566
5595
  return new LLM(ctx);
5567
5596
  };
5597
+ /**
5598
+ * Load a LLMTokenUsage from its ID.
5599
+ */
5600
+ loadLLMTokenUsageFromID = (id) => {
5601
+ const ctx = this._ctx.select("loadLLMTokenUsageFromID", { id });
5602
+ return new LLMTokenUsage(ctx);
5603
+ };
5568
5604
  /**
5569
5605
  * Load a LLMVariable from its ID.
5570
5606
  */