@dagger.io/dagger 0.9.8 → 0.9.9

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.
Files changed (31) hide show
  1. package/dist/api/client.gen.d.ts +309 -49
  2. package/dist/api/client.gen.d.ts.map +1 -1
  3. package/dist/api/client.gen.js +496 -100
  4. package/dist/entrypoint/entrypoint.js +2 -1
  5. package/dist/entrypoint/invoke.d.ts.map +1 -1
  6. package/dist/entrypoint/invoke.js +25 -5
  7. package/dist/entrypoint/load.d.ts +43 -1
  8. package/dist/entrypoint/load.d.ts.map +1 -1
  9. package/dist/entrypoint/load.js +109 -2
  10. package/dist/entrypoint/register.d.ts.map +1 -1
  11. package/dist/entrypoint/register.js +7 -3
  12. package/dist/introspector/decorators/decorators.d.ts +3 -3
  13. package/dist/introspector/decorators/decorators.d.ts.map +1 -1
  14. package/dist/introspector/registry/registry.d.ts +5 -3
  15. package/dist/introspector/registry/registry.d.ts.map +1 -1
  16. package/dist/introspector/registry/registry.js +20 -28
  17. package/dist/introspector/scanner/metadata.d.ts +1 -0
  18. package/dist/introspector/scanner/metadata.d.ts.map +1 -1
  19. package/dist/introspector/scanner/scan.d.ts +5 -1
  20. package/dist/introspector/scanner/scan.d.ts.map +1 -1
  21. package/dist/introspector/scanner/scan.js +38 -5
  22. package/dist/introspector/scanner/serialize.d.ts.map +1 -1
  23. package/dist/introspector/scanner/serialize.js +8 -2
  24. package/dist/introspector/scanner/typeDefs.d.ts +3 -0
  25. package/dist/introspector/scanner/typeDefs.d.ts.map +1 -1
  26. package/dist/introspector/scanner/utils.d.ts +18 -2
  27. package/dist/introspector/scanner/utils.d.ts.map +1 -1
  28. package/dist/introspector/scanner/utils.js +85 -12
  29. package/dist/provisioning/default.d.ts +1 -1
  30. package/dist/provisioning/default.js +1 -1
  31. package/package.json +1 -1
@@ -648,22 +648,6 @@ export class Container extends BaseClient {
648
648
  ctx: this._ctx,
649
649
  });
650
650
  };
651
- /**
652
- * Return an interactive terminal for this container using its configured shell if not overridden by args (or sh as a fallback default).
653
- * @param opts.args If set, override the container's default shell and invoke these arguments instead.
654
- */
655
- shell = (opts) => {
656
- return new Terminal({
657
- queryTree: [
658
- ...this._queryTree,
659
- {
660
- operation: "shell",
661
- args: { ...opts },
662
- },
663
- ],
664
- ctx: this._ctx,
665
- });
666
- };
667
651
  /**
668
652
  * The error stream of the last executed command.
669
653
  *
@@ -712,6 +696,22 @@ export class Container extends BaseClient {
712
696
  ], await this._ctx.connection());
713
697
  return this;
714
698
  };
699
+ /**
700
+ * Return an interactive terminal for this container using its configured default terminal command if not overridden by args (or sh as a fallback default).
701
+ * @param opts.cmd If set, override the container's default terminal command and invoke these command arguments instead.
702
+ */
703
+ terminal = (opts) => {
704
+ return new Terminal({
705
+ queryTree: [
706
+ ...this._queryTree,
707
+ {
708
+ operation: "terminal",
709
+ args: { ...opts },
710
+ },
711
+ ],
712
+ ctx: this._ctx,
713
+ });
714
+ };
715
715
  /**
716
716
  * Retrieves the user to be set for all commands.
717
717
  */
@@ -744,15 +744,15 @@ export class Container extends BaseClient {
744
744
  });
745
745
  };
746
746
  /**
747
- * Set the default command to invoke for the "shell" API.
748
- * @param args The args of the command to set the default shell to.
747
+ * Set the default command to invoke for the container's terminal API.
748
+ * @param args The args of the command.
749
749
  */
750
- withDefaultShell = (args) => {
750
+ withDefaultTerminalCmd = (args) => {
751
751
  return new Container({
752
752
  queryTree: [
753
753
  ...this._queryTree,
754
754
  {
755
- operation: "withDefaultShell",
755
+ operation: "withDefaultTerminalCmd",
756
756
  args: { args },
757
757
  },
758
758
  ],
@@ -1523,7 +1523,7 @@ export class Directory extends BaseClient {
1523
1523
  };
1524
1524
  /**
1525
1525
  * Load the directory as a Dagger module
1526
- * @param opts.sourceSubpath An optional subpath of the directory which contains the module's source code.
1526
+ * @param opts.sourceRootPath An optional subpath of the directory which contains the module's configuration file.
1527
1527
  *
1528
1528
  * This is needed when the module code is in a subdirectory but requires parent directories to be loaded in order to execute. For example, the module source code may need a go.mod, project.toml, package.json, etc. file from a parent directory.
1529
1529
  *
@@ -1848,6 +1848,9 @@ export class EnvVariable extends BaseClient {
1848
1848
  ], await this._ctx.connection());
1849
1849
  return response;
1850
1850
  };
1851
+ /**
1852
+ * The environment variable name.
1853
+ */
1851
1854
  name = async () => {
1852
1855
  if (this._name) {
1853
1856
  return this._name;
@@ -1860,6 +1863,9 @@ export class EnvVariable extends BaseClient {
1860
1863
  ], await this._ctx.connection());
1861
1864
  return response;
1862
1865
  };
1866
+ /**
1867
+ * The environment variable value.
1868
+ */
1863
1869
  value = async () => {
1864
1870
  if (this._value) {
1865
1871
  return this._value;
@@ -1906,6 +1912,9 @@ export class FieldTypeDef extends BaseClient {
1906
1912
  ], await this._ctx.connection());
1907
1913
  return response;
1908
1914
  };
1915
+ /**
1916
+ * A doc string for the field, if any.
1917
+ */
1909
1918
  description = async () => {
1910
1919
  if (this._description) {
1911
1920
  return this._description;
@@ -1918,6 +1927,9 @@ export class FieldTypeDef extends BaseClient {
1918
1927
  ], await this._ctx.connection());
1919
1928
  return response;
1920
1929
  };
1930
+ /**
1931
+ * The name of the field in lowerCamelCase format.
1932
+ */
1921
1933
  name = async () => {
1922
1934
  if (this._name) {
1923
1935
  return this._name;
@@ -1930,6 +1942,9 @@ export class FieldTypeDef extends BaseClient {
1930
1942
  ], await this._ctx.connection());
1931
1943
  return response;
1932
1944
  };
1945
+ /**
1946
+ * The type of the field.
1947
+ */
1933
1948
  typeDef = () => {
1934
1949
  return new TypeDef({
1935
1950
  queryTree: [
@@ -2114,6 +2129,9 @@ export class Function_ extends BaseClient {
2114
2129
  ], await this._ctx.connection());
2115
2130
  return response;
2116
2131
  };
2132
+ /**
2133
+ * Arguments accepted by the function, if any.
2134
+ */
2117
2135
  args = async () => {
2118
2136
  const response = await computeQuery([
2119
2137
  ...this._queryTree,
@@ -2134,6 +2152,9 @@ export class Function_ extends BaseClient {
2134
2152
  ctx: this._ctx,
2135
2153
  }, r.id));
2136
2154
  };
2155
+ /**
2156
+ * A doc string for the function, if any.
2157
+ */
2137
2158
  description = async () => {
2138
2159
  if (this._description) {
2139
2160
  return this._description;
@@ -2146,6 +2167,9 @@ export class Function_ extends BaseClient {
2146
2167
  ], await this._ctx.connection());
2147
2168
  return response;
2148
2169
  };
2170
+ /**
2171
+ * The name of the function.
2172
+ */
2149
2173
  name = async () => {
2150
2174
  if (this._name) {
2151
2175
  return this._name;
@@ -2158,6 +2182,9 @@ export class Function_ extends BaseClient {
2158
2182
  ], await this._ctx.connection());
2159
2183
  return response;
2160
2184
  };
2185
+ /**
2186
+ * The type returned by the function.
2187
+ */
2161
2188
  returnType = () => {
2162
2189
  return new TypeDef({
2163
2190
  queryTree: [
@@ -2248,6 +2275,9 @@ export class FunctionArg extends BaseClient {
2248
2275
  ], await this._ctx.connection());
2249
2276
  return response;
2250
2277
  };
2278
+ /**
2279
+ * A default value to use for this argument when not explicitly set by the caller, if any.
2280
+ */
2251
2281
  defaultValue = async () => {
2252
2282
  if (this._defaultValue) {
2253
2283
  return this._defaultValue;
@@ -2260,6 +2290,9 @@ export class FunctionArg extends BaseClient {
2260
2290
  ], await this._ctx.connection());
2261
2291
  return response;
2262
2292
  };
2293
+ /**
2294
+ * A doc string for the argument, if any.
2295
+ */
2263
2296
  description = async () => {
2264
2297
  if (this._description) {
2265
2298
  return this._description;
@@ -2272,6 +2305,9 @@ export class FunctionArg extends BaseClient {
2272
2305
  ], await this._ctx.connection());
2273
2306
  return response;
2274
2307
  };
2308
+ /**
2309
+ * The name of the argument in lowerCamelCase format.
2310
+ */
2275
2311
  name = async () => {
2276
2312
  if (this._name) {
2277
2313
  return this._name;
@@ -2284,6 +2320,9 @@ export class FunctionArg extends BaseClient {
2284
2320
  ], await this._ctx.connection());
2285
2321
  return response;
2286
2322
  };
2323
+ /**
2324
+ * The type of the argument.
2325
+ */
2287
2326
  typeDef = () => {
2288
2327
  return new TypeDef({
2289
2328
  queryTree: [
@@ -2331,6 +2370,9 @@ export class FunctionCall extends BaseClient {
2331
2370
  ], await this._ctx.connection());
2332
2371
  return response;
2333
2372
  };
2373
+ /**
2374
+ * The argument values the function is being invoked with.
2375
+ */
2334
2376
  inputArgs = async () => {
2335
2377
  const response = await computeQuery([
2336
2378
  ...this._queryTree,
@@ -2351,6 +2393,9 @@ export class FunctionCall extends BaseClient {
2351
2393
  ctx: this._ctx,
2352
2394
  }, r.id));
2353
2395
  };
2396
+ /**
2397
+ * The name of the function being called.
2398
+ */
2354
2399
  name = async () => {
2355
2400
  if (this._name) {
2356
2401
  return this._name;
@@ -2363,6 +2408,9 @@ export class FunctionCall extends BaseClient {
2363
2408
  ], await this._ctx.connection());
2364
2409
  return response;
2365
2410
  };
2411
+ /**
2412
+ * The value of the parent object of the function being called. If the function is top-level to the module, this is always an empty object.
2413
+ */
2366
2414
  parent = async () => {
2367
2415
  if (this._parent) {
2368
2416
  return this._parent;
@@ -2375,6 +2423,9 @@ export class FunctionCall extends BaseClient {
2375
2423
  ], await this._ctx.connection());
2376
2424
  return response;
2377
2425
  };
2426
+ /**
2427
+ * The name of the parent object of the function being called. If the function is top-level to the module, this is the name of the module.
2428
+ */
2378
2429
  parentName = async () => {
2379
2430
  if (this._parentName) {
2380
2431
  return this._parentName;
@@ -2436,6 +2487,9 @@ export class FunctionCallArgValue extends BaseClient {
2436
2487
  ], await this._ctx.connection());
2437
2488
  return response;
2438
2489
  };
2490
+ /**
2491
+ * The name of the argument.
2492
+ */
2439
2493
  name = async () => {
2440
2494
  if (this._name) {
2441
2495
  return this._name;
@@ -2448,6 +2502,9 @@ export class FunctionCallArgValue extends BaseClient {
2448
2502
  ], await this._ctx.connection());
2449
2503
  return response;
2450
2504
  };
2505
+ /**
2506
+ * The value of the argument represented as a JSON serialized string.
2507
+ */
2451
2508
  value = async () => {
2452
2509
  if (this._value) {
2453
2510
  return this._value;
@@ -2488,6 +2545,9 @@ export class GeneratedCode extends BaseClient {
2488
2545
  ], await this._ctx.connection());
2489
2546
  return response;
2490
2547
  };
2548
+ /**
2549
+ * The directory containing the generated code.
2550
+ */
2491
2551
  code = () => {
2492
2552
  return new Directory({
2493
2553
  queryTree: [
@@ -2499,6 +2559,9 @@ export class GeneratedCode extends BaseClient {
2499
2559
  ctx: this._ctx,
2500
2560
  });
2501
2561
  };
2562
+ /**
2563
+ * List of paths to mark generated in version control (i.e. .gitattributes).
2564
+ */
2502
2565
  vcsGeneratedPaths = async () => {
2503
2566
  const response = await computeQuery([
2504
2567
  ...this._queryTree,
@@ -2508,6 +2571,9 @@ export class GeneratedCode extends BaseClient {
2508
2571
  ], await this._ctx.connection());
2509
2572
  return response;
2510
2573
  };
2574
+ /**
2575
+ * List of paths to ignore in version control (i.e. .gitignore).
2576
+ */
2511
2577
  vcsIgnoredPaths = async () => {
2512
2578
  const response = await computeQuery([
2513
2579
  ...this._queryTree,
@@ -2564,18 +2630,18 @@ export class GitModuleSource extends BaseClient {
2564
2630
  _cloneURL = undefined;
2565
2631
  _commit = undefined;
2566
2632
  _htmlURL = undefined;
2567
- _sourceSubpath = undefined;
2633
+ _rootSubpath = undefined;
2568
2634
  _version = undefined;
2569
2635
  /**
2570
2636
  * Constructor is used for internal usage only, do not create object from it.
2571
2637
  */
2572
- constructor(parent, _id, _cloneURL, _commit, _htmlURL, _sourceSubpath, _version) {
2638
+ constructor(parent, _id, _cloneURL, _commit, _htmlURL, _rootSubpath, _version) {
2573
2639
  super(parent);
2574
2640
  this._id = _id;
2575
2641
  this._cloneURL = _cloneURL;
2576
2642
  this._commit = _commit;
2577
2643
  this._htmlURL = _htmlURL;
2578
- this._sourceSubpath = _sourceSubpath;
2644
+ this._rootSubpath = _rootSubpath;
2579
2645
  this._version = _version;
2580
2646
  }
2581
2647
  /**
@@ -2608,6 +2674,9 @@ export class GitModuleSource extends BaseClient {
2608
2674
  ], await this._ctx.connection());
2609
2675
  return response;
2610
2676
  };
2677
+ /**
2678
+ * The resolved commit of the git repo this source points to.
2679
+ */
2611
2680
  commit = async () => {
2612
2681
  if (this._commit) {
2613
2682
  return this._commit;
@@ -2620,6 +2689,20 @@ export class GitModuleSource extends BaseClient {
2620
2689
  ], await this._ctx.connection());
2621
2690
  return response;
2622
2691
  };
2692
+ /**
2693
+ * The directory containing everything needed to load load and use the module.
2694
+ */
2695
+ contextDirectory = () => {
2696
+ return new Directory({
2697
+ queryTree: [
2698
+ ...this._queryTree,
2699
+ {
2700
+ operation: "contextDirectory",
2701
+ },
2702
+ ],
2703
+ ctx: this._ctx,
2704
+ });
2705
+ };
2623
2706
  /**
2624
2707
  * The URL to the source's git repo in a web browser
2625
2708
  */
@@ -2635,18 +2718,24 @@ export class GitModuleSource extends BaseClient {
2635
2718
  ], await this._ctx.connection());
2636
2719
  return response;
2637
2720
  };
2638
- sourceSubpath = async () => {
2639
- if (this._sourceSubpath) {
2640
- return this._sourceSubpath;
2721
+ /**
2722
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
2723
+ */
2724
+ rootSubpath = async () => {
2725
+ if (this._rootSubpath) {
2726
+ return this._rootSubpath;
2641
2727
  }
2642
2728
  const response = await computeQuery([
2643
2729
  ...this._queryTree,
2644
2730
  {
2645
- operation: "sourceSubpath",
2731
+ operation: "rootSubpath",
2646
2732
  },
2647
2733
  ], await this._ctx.connection());
2648
2734
  return response;
2649
2735
  };
2736
+ /**
2737
+ * The specified version of the git repo this source points to.
2738
+ */
2650
2739
  version = async () => {
2651
2740
  if (this._version) {
2652
2741
  return this._version;
@@ -2781,6 +2870,22 @@ export class GitRepository extends BaseClient {
2781
2870
  ctx: this._ctx,
2782
2871
  });
2783
2872
  };
2873
+ /**
2874
+ * Returns details of a ref.
2875
+ * @param name Ref's name (can be a commit identifier, a tag name, a branch name, or a fully-qualified ref).
2876
+ */
2877
+ ref = (name) => {
2878
+ return new GitRef({
2879
+ queryTree: [
2880
+ ...this._queryTree,
2881
+ {
2882
+ operation: "ref",
2883
+ args: { name },
2884
+ },
2885
+ ],
2886
+ ctx: this._ctx,
2887
+ });
2888
+ };
2784
2889
  /**
2785
2890
  * Returns details of a tag.
2786
2891
  * @param name Tag's name (e.g., "v0.3.9").
@@ -2974,6 +3079,9 @@ export class InputTypeDef extends BaseClient {
2974
3079
  ], await this._ctx.connection());
2975
3080
  return response;
2976
3081
  };
3082
+ /**
3083
+ * Static fields defined on this input object, if any.
3084
+ */
2977
3085
  fields = async () => {
2978
3086
  const response = await computeQuery([
2979
3087
  ...this._queryTree,
@@ -2994,6 +3102,9 @@ export class InputTypeDef extends BaseClient {
2994
3102
  ctx: this._ctx,
2995
3103
  }, r.id));
2996
3104
  };
3105
+ /**
3106
+ * The name of the input object.
3107
+ */
2997
3108
  name = async () => {
2998
3109
  if (this._name) {
2999
3110
  return this._name;
@@ -3040,6 +3151,9 @@ export class InterfaceTypeDef extends BaseClient {
3040
3151
  ], await this._ctx.connection());
3041
3152
  return response;
3042
3153
  };
3154
+ /**
3155
+ * The doc string for the interface, if any.
3156
+ */
3043
3157
  description = async () => {
3044
3158
  if (this._description) {
3045
3159
  return this._description;
@@ -3052,6 +3166,9 @@ export class InterfaceTypeDef extends BaseClient {
3052
3166
  ], await this._ctx.connection());
3053
3167
  return response;
3054
3168
  };
3169
+ /**
3170
+ * Functions defined on this interface, if any.
3171
+ */
3055
3172
  functions = async () => {
3056
3173
  const response = await computeQuery([
3057
3174
  ...this._queryTree,
@@ -3072,6 +3189,9 @@ export class InterfaceTypeDef extends BaseClient {
3072
3189
  ctx: this._ctx,
3073
3190
  }, r.id));
3074
3191
  };
3192
+ /**
3193
+ * The name of the interface.
3194
+ */
3075
3195
  name = async () => {
3076
3196
  if (this._name) {
3077
3197
  return this._name;
@@ -3084,6 +3204,9 @@ export class InterfaceTypeDef extends BaseClient {
3084
3204
  ], await this._ctx.connection());
3085
3205
  return response;
3086
3206
  };
3207
+ /**
3208
+ * If this InterfaceTypeDef is associated with a Module, the name of the module. Unset otherwise.
3209
+ */
3087
3210
  sourceModuleName = async () => {
3088
3211
  if (this._sourceModuleName) {
3089
3212
  return this._sourceModuleName;
@@ -3128,6 +3251,9 @@ export class Label extends BaseClient {
3128
3251
  ], await this._ctx.connection());
3129
3252
  return response;
3130
3253
  };
3254
+ /**
3255
+ * The label name.
3256
+ */
3131
3257
  name = async () => {
3132
3258
  if (this._name) {
3133
3259
  return this._name;
@@ -3140,6 +3266,9 @@ export class Label extends BaseClient {
3140
3266
  ], await this._ctx.connection());
3141
3267
  return response;
3142
3268
  };
3269
+ /**
3270
+ * The label value.
3271
+ */
3143
3272
  value = async () => {
3144
3273
  if (this._value) {
3145
3274
  return this._value;
@@ -3180,6 +3309,9 @@ export class ListTypeDef extends BaseClient {
3180
3309
  ], await this._ctx.connection());
3181
3310
  return response;
3182
3311
  };
3312
+ /**
3313
+ * The type of the elements in the list.
3314
+ */
3183
3315
  elementTypeDef = () => {
3184
3316
  return new TypeDef({
3185
3317
  queryTree: [
@@ -3197,14 +3329,14 @@ export class ListTypeDef extends BaseClient {
3197
3329
  */
3198
3330
  export class LocalModuleSource extends BaseClient {
3199
3331
  _id = undefined;
3200
- _sourceSubpath = undefined;
3332
+ _rootSubpath = undefined;
3201
3333
  /**
3202
3334
  * Constructor is used for internal usage only, do not create object from it.
3203
3335
  */
3204
- constructor(parent, _id, _sourceSubpath) {
3336
+ constructor(parent, _id, _rootSubpath) {
3205
3337
  super(parent);
3206
3338
  this._id = _id;
3207
- this._sourceSubpath = _sourceSubpath;
3339
+ this._rootSubpath = _rootSubpath;
3208
3340
  }
3209
3341
  /**
3210
3342
  * A unique identifier for this LocalModuleSource.
@@ -3221,14 +3353,31 @@ export class LocalModuleSource extends BaseClient {
3221
3353
  ], await this._ctx.connection());
3222
3354
  return response;
3223
3355
  };
3224
- sourceSubpath = async () => {
3225
- if (this._sourceSubpath) {
3226
- return this._sourceSubpath;
3356
+ /**
3357
+ * The directory containing everything needed to load load and use the module.
3358
+ */
3359
+ contextDirectory = () => {
3360
+ return new Directory({
3361
+ queryTree: [
3362
+ ...this._queryTree,
3363
+ {
3364
+ operation: "contextDirectory",
3365
+ },
3366
+ ],
3367
+ ctx: this._ctx,
3368
+ });
3369
+ };
3370
+ /**
3371
+ * The path to the root of the module source under the context directory. This directory contains its configuration file. It also contains its source code (possibly as a subdirectory).
3372
+ */
3373
+ rootSubpath = async () => {
3374
+ if (this._rootSubpath) {
3375
+ return this._rootSubpath;
3227
3376
  }
3228
3377
  const response = await computeQuery([
3229
3378
  ...this._queryTree,
3230
3379
  {
3231
- operation: "sourceSubpath",
3380
+ operation: "rootSubpath",
3232
3381
  },
3233
3382
  ], await this._ctx.connection());
3234
3383
  return response;
@@ -3269,6 +3418,9 @@ export class Module_ extends BaseClient {
3269
3418
  ], await this._ctx.connection());
3270
3419
  return response;
3271
3420
  };
3421
+ /**
3422
+ * Modules used by this module.
3423
+ */
3272
3424
  dependencies = async () => {
3273
3425
  const response = await computeQuery([
3274
3426
  ...this._queryTree,
@@ -3289,6 +3441,9 @@ export class Module_ extends BaseClient {
3289
3441
  ctx: this._ctx,
3290
3442
  }, r.id));
3291
3443
  };
3444
+ /**
3445
+ * The dependencies as configured by the module.
3446
+ */
3292
3447
  dependencyConfig = async () => {
3293
3448
  const response = await computeQuery([
3294
3449
  ...this._queryTree,
@@ -3309,6 +3464,9 @@ export class Module_ extends BaseClient {
3309
3464
  ctx: this._ctx,
3310
3465
  }, r.id));
3311
3466
  };
3467
+ /**
3468
+ * The doc string of the module, if any
3469
+ */
3312
3470
  description = async () => {
3313
3471
  if (this._description) {
3314
3472
  return this._description;
@@ -3322,14 +3480,28 @@ export class Module_ extends BaseClient {
3322
3480
  return response;
3323
3481
  };
3324
3482
  /**
3325
- * The module's root directory containing the config file for it and its source (possibly as a subdir). It includes any generated code or updated config files created after initial load, but not any files/directories that were unchanged after sdk codegen was run.
3483
+ * The generated files and directories made on top of the module source's context directory.
3484
+ */
3485
+ generatedContextDiff = () => {
3486
+ return new Directory({
3487
+ queryTree: [
3488
+ ...this._queryTree,
3489
+ {
3490
+ operation: "generatedContextDiff",
3491
+ },
3492
+ ],
3493
+ ctx: this._ctx,
3494
+ });
3495
+ };
3496
+ /**
3497
+ * The module source's context plus any configuration and source files created by codegen.
3326
3498
  */
3327
- generatedSourceRootDirectory = () => {
3499
+ generatedContextDirectory = () => {
3328
3500
  return new Directory({
3329
3501
  queryTree: [
3330
3502
  ...this._queryTree,
3331
3503
  {
3332
- operation: "generatedSourceRootDirectory",
3504
+ operation: "generatedContextDirectory",
3333
3505
  },
3334
3506
  ],
3335
3507
  ctx: this._ctx,
@@ -3349,6 +3521,9 @@ export class Module_ extends BaseClient {
3349
3521
  ctx: this._ctx,
3350
3522
  });
3351
3523
  };
3524
+ /**
3525
+ * Interfaces served by this module.
3526
+ */
3352
3527
  interfaces = async () => {
3353
3528
  const response = await computeQuery([
3354
3529
  ...this._queryTree,
@@ -3369,6 +3544,9 @@ export class Module_ extends BaseClient {
3369
3544
  ctx: this._ctx,
3370
3545
  }, r.id));
3371
3546
  };
3547
+ /**
3548
+ * The name of the module
3549
+ */
3372
3550
  name = async () => {
3373
3551
  if (this._name) {
3374
3552
  return this._name;
@@ -3381,6 +3559,9 @@ export class Module_ extends BaseClient {
3381
3559
  ], await this._ctx.connection());
3382
3560
  return response;
3383
3561
  };
3562
+ /**
3563
+ * Objects served by this module.
3564
+ */
3384
3565
  objects = async () => {
3385
3566
  const response = await computeQuery([
3386
3567
  ...this._queryTree,
@@ -3401,6 +3582,9 @@ export class Module_ extends BaseClient {
3401
3582
  ctx: this._ctx,
3402
3583
  }, r.id));
3403
3584
  };
3585
+ /**
3586
+ * The container that runs the module's entrypoint. It will fail to execute if the module doesn't compile.
3587
+ */
3404
3588
  runtime = () => {
3405
3589
  return new Container({
3406
3590
  queryTree: [
@@ -3412,6 +3596,9 @@ export class Module_ extends BaseClient {
3412
3596
  ctx: this._ctx,
3413
3597
  });
3414
3598
  };
3599
+ /**
3600
+ * The SDK used by this module. Either a name of a builtin SDK or a module source ref string pointing to the SDK's implementation.
3601
+ */
3415
3602
  sdk = async () => {
3416
3603
  if (this._sdk) {
3417
3604
  return this._sdk;
@@ -3441,6 +3628,9 @@ export class Module_ extends BaseClient {
3441
3628
  ], await this._ctx.connection());
3442
3629
  return response;
3443
3630
  };
3631
+ /**
3632
+ * The source for the module.
3633
+ */
3444
3634
  source = () => {
3445
3635
  return new ModuleSource({
3446
3636
  queryTree: [
@@ -3452,22 +3642,6 @@ export class Module_ extends BaseClient {
3452
3642
  ctx: this._ctx,
3453
3643
  });
3454
3644
  };
3455
- /**
3456
- * Update the module configuration to use the given dependencies.
3457
- * @param dependencies The dependency modules to install.
3458
- */
3459
- withDependencies = (dependencies) => {
3460
- return new Module_({
3461
- queryTree: [
3462
- ...this._queryTree,
3463
- {
3464
- operation: "withDependencies",
3465
- args: { dependencies },
3466
- },
3467
- ],
3468
- ctx: this._ctx,
3469
- });
3470
- };
3471
3645
  /**
3472
3646
  * Retrieves the module with the given description
3473
3647
  * @param description The description to set
@@ -3499,22 +3673,6 @@ export class Module_ extends BaseClient {
3499
3673
  ctx: this._ctx,
3500
3674
  });
3501
3675
  };
3502
- /**
3503
- * Update the module configuration to use the given name.
3504
- * @param name The name to use.
3505
- */
3506
- withName = (name) => {
3507
- return new Module_({
3508
- queryTree: [
3509
- ...this._queryTree,
3510
- {
3511
- operation: "withName",
3512
- args: { name },
3513
- },
3514
- ],
3515
- ctx: this._ctx,
3516
- });
3517
- };
3518
3676
  /**
3519
3677
  * This module plus the given Object type and associated functions.
3520
3678
  */
@@ -3530,22 +3688,6 @@ export class Module_ extends BaseClient {
3530
3688
  ctx: this._ctx,
3531
3689
  });
3532
3690
  };
3533
- /**
3534
- * Update the module configuration to use the given SDK.
3535
- * @param sdk The SDK to use.
3536
- */
3537
- withSDK = (sdk) => {
3538
- return new Module_({
3539
- queryTree: [
3540
- ...this._queryTree,
3541
- {
3542
- operation: "withSDK",
3543
- args: { sdk },
3544
- },
3545
- ],
3546
- ctx: this._ctx,
3547
- });
3548
- };
3549
3691
  /**
3550
3692
  * Retrieves the module with basic configuration loaded if present.
3551
3693
  * @param source The module source to initialize from.
@@ -3600,6 +3742,9 @@ export class ModuleDependency extends BaseClient {
3600
3742
  ], await this._ctx.connection());
3601
3743
  return response;
3602
3744
  };
3745
+ /**
3746
+ * The name of the dependency module.
3747
+ */
3603
3748
  name = async () => {
3604
3749
  if (this._name) {
3605
3750
  return this._name;
@@ -3612,6 +3757,9 @@ export class ModuleDependency extends BaseClient {
3612
3757
  ], await this._ctx.connection());
3613
3758
  return response;
3614
3759
  };
3760
+ /**
3761
+ * The source for the dependency module.
3762
+ */
3615
3763
  source = () => {
3616
3764
  return new ModuleSource({
3617
3765
  queryTree: [
@@ -3630,19 +3778,27 @@ export class ModuleDependency extends BaseClient {
3630
3778
  export class ModuleSource extends BaseClient {
3631
3779
  _id = undefined;
3632
3780
  _asString = undefined;
3781
+ _configExists = undefined;
3633
3782
  _kind = undefined;
3634
3783
  _moduleName = undefined;
3635
- _subpath = undefined;
3784
+ _moduleOriginalName = undefined;
3785
+ _resolveContextPathFromCaller = undefined;
3786
+ _sourceRootSubpath = undefined;
3787
+ _sourceSubpath = undefined;
3636
3788
  /**
3637
3789
  * Constructor is used for internal usage only, do not create object from it.
3638
3790
  */
3639
- constructor(parent, _id, _asString, _kind, _moduleName, _subpath) {
3791
+ constructor(parent, _id, _asString, _configExists, _kind, _moduleName, _moduleOriginalName, _resolveContextPathFromCaller, _sourceRootSubpath, _sourceSubpath) {
3640
3792
  super(parent);
3641
3793
  this._id = _id;
3642
3794
  this._asString = _asString;
3795
+ this._configExists = _configExists;
3643
3796
  this._kind = _kind;
3644
3797
  this._moduleName = _moduleName;
3645
- this._subpath = _subpath;
3798
+ this._moduleOriginalName = _moduleOriginalName;
3799
+ this._resolveContextPathFromCaller = _resolveContextPathFromCaller;
3800
+ this._sourceRootSubpath = _sourceRootSubpath;
3801
+ this._sourceSubpath = _sourceSubpath;
3646
3802
  }
3647
3803
  /**
3648
3804
  * A unique identifier for this ModuleSource.
@@ -3659,6 +3815,9 @@ export class ModuleSource extends BaseClient {
3659
3815
  ], await this._ctx.connection());
3660
3816
  return response;
3661
3817
  };
3818
+ /**
3819
+ * If the source is a of kind git, the git source representation of it.
3820
+ */
3662
3821
  asGitSource = () => {
3663
3822
  return new GitModuleSource({
3664
3823
  queryTree: [
@@ -3670,6 +3829,9 @@ export class ModuleSource extends BaseClient {
3670
3829
  ctx: this._ctx,
3671
3830
  });
3672
3831
  };
3832
+ /**
3833
+ * If the source is of kind local, the local source representation of it.
3834
+ */
3673
3835
  asLocalSource = () => {
3674
3836
  return new LocalModuleSource({
3675
3837
  queryTree: [
@@ -3711,7 +3873,59 @@ export class ModuleSource extends BaseClient {
3711
3873
  return response;
3712
3874
  };
3713
3875
  /**
3714
- * The directory containing the actual module's source code, as determined from the root directory and subpath.
3876
+ * Returns whether the module source has a configuration file.
3877
+ */
3878
+ configExists = async () => {
3879
+ if (this._configExists) {
3880
+ return this._configExists;
3881
+ }
3882
+ const response = await computeQuery([
3883
+ ...this._queryTree,
3884
+ {
3885
+ operation: "configExists",
3886
+ },
3887
+ ], await this._ctx.connection());
3888
+ return response;
3889
+ };
3890
+ /**
3891
+ * The directory containing everything needed to load load and use the module.
3892
+ */
3893
+ contextDirectory = () => {
3894
+ return new Directory({
3895
+ queryTree: [
3896
+ ...this._queryTree,
3897
+ {
3898
+ operation: "contextDirectory",
3899
+ },
3900
+ ],
3901
+ ctx: this._ctx,
3902
+ });
3903
+ };
3904
+ /**
3905
+ * The dependencies of the module source. Includes dependencies from the configuration and any extras from withDependencies calls.
3906
+ */
3907
+ dependencies = async () => {
3908
+ const response = await computeQuery([
3909
+ ...this._queryTree,
3910
+ {
3911
+ operation: "dependencies",
3912
+ },
3913
+ {
3914
+ operation: "id",
3915
+ },
3916
+ ], await this._ctx.connection());
3917
+ return response.map((r) => new ModuleDependency({
3918
+ queryTree: [
3919
+ {
3920
+ operation: "loadModuleDependencyFromID",
3921
+ args: { id: r.id },
3922
+ },
3923
+ ],
3924
+ ctx: this._ctx,
3925
+ }, r.id));
3926
+ };
3927
+ /**
3928
+ * The directory containing the module configuration and source code (source code may be in a subdir).
3715
3929
  * @param path The path from the source directory to select.
3716
3930
  */
3717
3931
  directory = (path) => {
@@ -3726,6 +3940,9 @@ export class ModuleSource extends BaseClient {
3726
3940
  ctx: this._ctx,
3727
3941
  });
3728
3942
  };
3943
+ /**
3944
+ * The kind of source (e.g. local, git, etc.)
3945
+ */
3729
3946
  kind = async () => {
3730
3947
  if (this._kind) {
3731
3948
  return this._kind;
@@ -3739,7 +3956,7 @@ export class ModuleSource extends BaseClient {
3739
3956
  return response;
3740
3957
  };
3741
3958
  /**
3742
- * If set, the name of the module this source references
3959
+ * If set, the name of the module this source references, including any overrides at runtime by callers.
3743
3960
  */
3744
3961
  moduleName = async () => {
3745
3962
  if (this._moduleName) {
@@ -3753,6 +3970,36 @@ export class ModuleSource extends BaseClient {
3753
3970
  ], await this._ctx.connection());
3754
3971
  return response;
3755
3972
  };
3973
+ /**
3974
+ * The original name of the module this source references, as defined in the module configuration.
3975
+ */
3976
+ moduleOriginalName = async () => {
3977
+ if (this._moduleOriginalName) {
3978
+ return this._moduleOriginalName;
3979
+ }
3980
+ const response = await computeQuery([
3981
+ ...this._queryTree,
3982
+ {
3983
+ operation: "moduleOriginalName",
3984
+ },
3985
+ ], await this._ctx.connection());
3986
+ return response;
3987
+ };
3988
+ /**
3989
+ * The path to the module source's context directory on the caller's filesystem. Only valid for local sources.
3990
+ */
3991
+ resolveContextPathFromCaller = async () => {
3992
+ if (this._resolveContextPathFromCaller) {
3993
+ return this._resolveContextPathFromCaller;
3994
+ }
3995
+ const response = await computeQuery([
3996
+ ...this._queryTree,
3997
+ {
3998
+ operation: "resolveContextPathFromCaller",
3999
+ },
4000
+ ], await this._ctx.connection());
4001
+ return response;
4002
+ };
3756
4003
  /**
3757
4004
  * Resolve the provided module source arg as a dependency relative to this module source.
3758
4005
  * @param dep The dependency module source to resolve.
@@ -3769,32 +4016,130 @@ export class ModuleSource extends BaseClient {
3769
4016
  ctx: this._ctx,
3770
4017
  });
3771
4018
  };
3772
- rootDirectory = () => {
3773
- return new Directory({
4019
+ /**
4020
+ * Load the source from its path on the caller's filesystem, including only needed+configured files and directories. Only valid for local sources.
4021
+ */
4022
+ resolveFromCaller = () => {
4023
+ return new ModuleSource({
3774
4024
  queryTree: [
3775
4025
  ...this._queryTree,
3776
4026
  {
3777
- operation: "rootDirectory",
4027
+ operation: "resolveFromCaller",
3778
4028
  },
3779
4029
  ],
3780
4030
  ctx: this._ctx,
3781
4031
  });
3782
4032
  };
3783
4033
  /**
3784
- * The path to the module subdirectory containing the actual module's source code.
4034
+ * The path relative to context of the root of the module source, which contains dagger.json. It also contains the module implementation source code, but that may or may not being a subdir of this root.
3785
4035
  */
3786
- subpath = async () => {
3787
- if (this._subpath) {
3788
- return this._subpath;
4036
+ sourceRootSubpath = async () => {
4037
+ if (this._sourceRootSubpath) {
4038
+ return this._sourceRootSubpath;
3789
4039
  }
3790
4040
  const response = await computeQuery([
3791
4041
  ...this._queryTree,
3792
4042
  {
3793
- operation: "subpath",
4043
+ operation: "sourceRootSubpath",
3794
4044
  },
3795
4045
  ], await this._ctx.connection());
3796
4046
  return response;
3797
4047
  };
4048
+ /**
4049
+ * The path relative to context of the module implementation source code.
4050
+ */
4051
+ sourceSubpath = async () => {
4052
+ if (this._sourceSubpath) {
4053
+ return this._sourceSubpath;
4054
+ }
4055
+ const response = await computeQuery([
4056
+ ...this._queryTree,
4057
+ {
4058
+ operation: "sourceSubpath",
4059
+ },
4060
+ ], await this._ctx.connection());
4061
+ return response;
4062
+ };
4063
+ /**
4064
+ * Update the module source with a new context directory. Only valid for local sources.
4065
+ * @param dir The directory to set as the context directory.
4066
+ */
4067
+ withContextDirectory = (dir) => {
4068
+ return new ModuleSource({
4069
+ queryTree: [
4070
+ ...this._queryTree,
4071
+ {
4072
+ operation: "withContextDirectory",
4073
+ args: { dir },
4074
+ },
4075
+ ],
4076
+ ctx: this._ctx,
4077
+ });
4078
+ };
4079
+ /**
4080
+ * Append the provided dependencies to the module source's dependency list.
4081
+ * @param dependencies The dependencies to append.
4082
+ */
4083
+ withDependencies = (dependencies) => {
4084
+ return new ModuleSource({
4085
+ queryTree: [
4086
+ ...this._queryTree,
4087
+ {
4088
+ operation: "withDependencies",
4089
+ args: { dependencies },
4090
+ },
4091
+ ],
4092
+ ctx: this._ctx,
4093
+ });
4094
+ };
4095
+ /**
4096
+ * Update the module source with a new name.
4097
+ * @param name The name to set.
4098
+ */
4099
+ withName = (name) => {
4100
+ return new ModuleSource({
4101
+ queryTree: [
4102
+ ...this._queryTree,
4103
+ {
4104
+ operation: "withName",
4105
+ args: { name },
4106
+ },
4107
+ ],
4108
+ ctx: this._ctx,
4109
+ });
4110
+ };
4111
+ /**
4112
+ * Update the module source with a new SDK.
4113
+ * @param sdk The SDK to set.
4114
+ */
4115
+ withSDK = (sdk) => {
4116
+ return new ModuleSource({
4117
+ queryTree: [
4118
+ ...this._queryTree,
4119
+ {
4120
+ operation: "withSDK",
4121
+ args: { sdk },
4122
+ },
4123
+ ],
4124
+ ctx: this._ctx,
4125
+ });
4126
+ };
4127
+ /**
4128
+ * Update the module source with a new source subpath.
4129
+ * @param path The path to set as the source subpath.
4130
+ */
4131
+ withSourceSubpath = (path) => {
4132
+ return new ModuleSource({
4133
+ queryTree: [
4134
+ ...this._queryTree,
4135
+ {
4136
+ operation: "withSourceSubpath",
4137
+ args: { path },
4138
+ },
4139
+ ],
4140
+ ctx: this._ctx,
4141
+ });
4142
+ };
3798
4143
  /**
3799
4144
  * Call the provided function with current ModuleSource.
3800
4145
  *
@@ -3837,6 +4182,9 @@ export class ObjectTypeDef extends BaseClient {
3837
4182
  ], await this._ctx.connection());
3838
4183
  return response;
3839
4184
  };
4185
+ /**
4186
+ * The function used to construct new instances of this object, if any
4187
+ */
3840
4188
  constructor_ = () => {
3841
4189
  return new Function_({
3842
4190
  queryTree: [
@@ -3848,6 +4196,9 @@ export class ObjectTypeDef extends BaseClient {
3848
4196
  ctx: this._ctx,
3849
4197
  });
3850
4198
  };
4199
+ /**
4200
+ * The doc string for the object, if any.
4201
+ */
3851
4202
  description = async () => {
3852
4203
  if (this._description) {
3853
4204
  return this._description;
@@ -3860,6 +4211,9 @@ export class ObjectTypeDef extends BaseClient {
3860
4211
  ], await this._ctx.connection());
3861
4212
  return response;
3862
4213
  };
4214
+ /**
4215
+ * Static fields defined on this object, if any.
4216
+ */
3863
4217
  fields = async () => {
3864
4218
  const response = await computeQuery([
3865
4219
  ...this._queryTree,
@@ -3880,6 +4234,9 @@ export class ObjectTypeDef extends BaseClient {
3880
4234
  ctx: this._ctx,
3881
4235
  }, r.id));
3882
4236
  };
4237
+ /**
4238
+ * Functions defined on this object, if any.
4239
+ */
3883
4240
  functions = async () => {
3884
4241
  const response = await computeQuery([
3885
4242
  ...this._queryTree,
@@ -3900,6 +4257,9 @@ export class ObjectTypeDef extends BaseClient {
3900
4257
  ctx: this._ctx,
3901
4258
  }, r.id));
3902
4259
  };
4260
+ /**
4261
+ * The name of the object.
4262
+ */
3903
4263
  name = async () => {
3904
4264
  if (this._name) {
3905
4265
  return this._name;
@@ -3912,6 +4272,9 @@ export class ObjectTypeDef extends BaseClient {
3912
4272
  ], await this._ctx.connection());
3913
4273
  return response;
3914
4274
  };
4275
+ /**
4276
+ * If this ObjectTypeDef is associated with a Module, the name of the module. Unset otherwise.
4277
+ */
3915
4278
  sourceModuleName = async () => {
3916
4279
  if (this._sourceModuleName) {
3917
4280
  return this._sourceModuleName;
@@ -3960,6 +4323,9 @@ export class Port extends BaseClient {
3960
4323
  ], await this._ctx.connection());
3961
4324
  return response;
3962
4325
  };
4326
+ /**
4327
+ * The port description.
4328
+ */
3963
4329
  description = async () => {
3964
4330
  if (this._description) {
3965
4331
  return this._description;
@@ -3972,6 +4338,9 @@ export class Port extends BaseClient {
3972
4338
  ], await this._ctx.connection());
3973
4339
  return response;
3974
4340
  };
4341
+ /**
4342
+ * Skip the health check when run as a service.
4343
+ */
3975
4344
  experimentalSkipHealthcheck = async () => {
3976
4345
  if (this._experimentalSkipHealthcheck) {
3977
4346
  return this._experimentalSkipHealthcheck;
@@ -3984,6 +4353,9 @@ export class Port extends BaseClient {
3984
4353
  ], await this._ctx.connection());
3985
4354
  return response;
3986
4355
  };
4356
+ /**
4357
+ * The port number.
4358
+ */
3987
4359
  port = async () => {
3988
4360
  if (this._port) {
3989
4361
  return this._port;
@@ -3996,6 +4368,9 @@ export class Port extends BaseClient {
3996
4368
  ], await this._ctx.connection());
3997
4369
  return response;
3998
4370
  };
4371
+ /**
4372
+ * The transport layer protocol.
4373
+ */
3999
4374
  protocol = async () => {
4000
4375
  if (this._protocol) {
4001
4376
  return this._protocol;
@@ -4773,7 +5148,6 @@ export class Client extends BaseClient {
4773
5148
  /**
4774
5149
  * Create a new module source instance from a source ref string.
4775
5150
  * @param refString The string ref representation of the module source
4776
- * @param opts.rootDirectory An explicitly set root directory for the module source. This is required to load local sources as modules; other source types implicitly encode the root directory and do not require this.
4777
5151
  * @param opts.stable If true, enforce that the source is a stable version for source kinds that support versioning.
4778
5152
  */
4779
5153
  moduleSource = (refString, opts) => {
@@ -5051,6 +5425,10 @@ export class Service extends BaseClient {
5051
5425
  };
5052
5426
  /**
5053
5427
  * Creates a tunnel that forwards traffic from the caller's network to this service.
5428
+ * @param opts.ports List of frontend/backend port mappings to forward.
5429
+ *
5430
+ * Frontend is the port accepting traffic on the host, backend is the service port.
5431
+ * @param opts.random Bind each tunnel port to a random port on the host.
5054
5432
  */
5055
5433
  up = async (opts) => {
5056
5434
  if (this._up) {
@@ -5170,6 +5548,9 @@ export class TypeDef extends BaseClient {
5170
5548
  ], await this._ctx.connection());
5171
5549
  return response;
5172
5550
  };
5551
+ /**
5552
+ * If kind is INPUT, the input-specific type definition. If kind is not INPUT, this will be null.
5553
+ */
5173
5554
  asInput = () => {
5174
5555
  return new InputTypeDef({
5175
5556
  queryTree: [
@@ -5181,6 +5562,9 @@ export class TypeDef extends BaseClient {
5181
5562
  ctx: this._ctx,
5182
5563
  });
5183
5564
  };
5565
+ /**
5566
+ * If kind is INTERFACE, the interface-specific type definition. If kind is not INTERFACE, this will be null.
5567
+ */
5184
5568
  asInterface = () => {
5185
5569
  return new InterfaceTypeDef({
5186
5570
  queryTree: [
@@ -5192,6 +5576,9 @@ export class TypeDef extends BaseClient {
5192
5576
  ctx: this._ctx,
5193
5577
  });
5194
5578
  };
5579
+ /**
5580
+ * If kind is LIST, the list-specific type definition. If kind is not LIST, this will be null.
5581
+ */
5195
5582
  asList = () => {
5196
5583
  return new ListTypeDef({
5197
5584
  queryTree: [
@@ -5203,6 +5590,9 @@ export class TypeDef extends BaseClient {
5203
5590
  ctx: this._ctx,
5204
5591
  });
5205
5592
  };
5593
+ /**
5594
+ * If kind is OBJECT, the object-specific type definition. If kind is not OBJECT, this will be null.
5595
+ */
5206
5596
  asObject = () => {
5207
5597
  return new ObjectTypeDef({
5208
5598
  queryTree: [
@@ -5214,6 +5604,9 @@ export class TypeDef extends BaseClient {
5214
5604
  ctx: this._ctx,
5215
5605
  });
5216
5606
  };
5607
+ /**
5608
+ * The kind of type this is (e.g. primitive, list, object).
5609
+ */
5217
5610
  kind = async () => {
5218
5611
  if (this._kind) {
5219
5612
  return this._kind;
@@ -5226,6 +5619,9 @@ export class TypeDef extends BaseClient {
5226
5619
  ], await this._ctx.connection());
5227
5620
  return response;
5228
5621
  };
5622
+ /**
5623
+ * Whether this type can be set to null. Defaults to false.
5624
+ */
5229
5625
  optional = async () => {
5230
5626
  if (this._optional) {
5231
5627
  return this._optional;