@shipload/sdk 1.0.0-next.70 → 1.0.0-next.72

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 (42) hide show
  1. package/lib/shipload.d.ts +266 -101
  2. package/lib/shipload.js +898 -404
  3. package/lib/shipload.js.map +1 -1
  4. package/lib/shipload.m.js +880 -398
  5. package/lib/shipload.m.js.map +1 -1
  6. package/lib/testing.d.ts +51 -13
  7. package/lib/testing.js +209 -64
  8. package/lib/testing.js.map +1 -1
  9. package/lib/testing.m.js +209 -64
  10. package/lib/testing.m.js.map +1 -1
  11. package/package.json +1 -1
  12. package/src/contracts/server.ts +140 -34
  13. package/src/data/capability-formulas.ts +4 -4
  14. package/src/data/entities.json +84 -68
  15. package/src/data/item-ids.ts +5 -4
  16. package/src/data/items.json +30 -24
  17. package/src/data/kind-registry.json +75 -39
  18. package/src/data/kind-registry.ts +13 -0
  19. package/src/data/metadata.ts +35 -0
  20. package/src/data/recipes.json +194 -155
  21. package/src/derivation/build-methods.test.ts +4 -4
  22. package/src/derivation/capabilities.test.ts +14 -10
  23. package/src/derivation/capabilities.ts +8 -10
  24. package/src/derivation/capability-mappings.ts +4 -4
  25. package/src/derivation/capacity-fn-registry.test.ts +9 -0
  26. package/src/derivation/capacity-fn-registry.ts +18 -0
  27. package/src/derivation/recipe-usage.test.ts +7 -11
  28. package/src/index-module.ts +28 -8
  29. package/src/influence/influence.test.ts +1 -1
  30. package/src/managers/actions.ts +19 -4
  31. package/src/managers/context.ts +9 -0
  32. package/src/managers/fund.ts +49 -0
  33. package/src/managers/index.ts +3 -0
  34. package/src/managers/jobs.test.ts +25 -9
  35. package/src/managers/jobs.ts +8 -4
  36. package/src/nft/description.ts +5 -10
  37. package/src/receipts.ts +9 -9
  38. package/src/resolution/resolve-item.test.ts +15 -10
  39. package/src/scheduling/jobs.test.ts +417 -18
  40. package/src/scheduling/jobs.ts +222 -16
  41. package/src/scheduling/lanes.ts +53 -1
  42. package/src/shipload.ts +5 -0
package/lib/testing.d.ts CHANGED
@@ -87,11 +87,6 @@ declare namespace Types {
87
87
  id: UInt64;
88
88
  inputs: cargo_item[];
89
89
  }
90
- class booking_receipt extends Struct {
91
- job_id: UInt64;
92
- lands_at: TimePoint;
93
- runtime: UInt32;
94
- }
95
90
  class builder_lane extends Struct {
96
91
  slot_index: UInt8;
97
92
  speed: UInt16;
@@ -105,7 +100,6 @@ declare namespace Types {
105
100
  class buildjob extends Struct {
106
101
  target_id: UInt64;
107
102
  dock_id: UInt64;
108
- slot: UInt8;
109
103
  target_item_id: UInt16;
110
104
  inputs: cargo_item[];
111
105
  }
@@ -126,6 +120,7 @@ declare namespace Types {
126
120
  target_item_id: UInt16;
127
121
  cargo: cargo_item[];
128
122
  deposited: boolean;
123
+ arrives_at: TimePoint;
129
124
  }
130
125
  class buildjobs_result extends Struct {
131
126
  jobs: buildjob_row[];
@@ -159,6 +154,9 @@ declare namespace Types {
159
154
  lane_key: UInt8;
160
155
  from_id: UInt64;
161
156
  }
157
+ class cancelcraft extends Struct {
158
+ job_id: UInt64;
159
+ }
162
160
  class cargo_row extends Struct {
163
161
  id: UInt64;
164
162
  entity_id: UInt64;
@@ -363,7 +361,6 @@ declare namespace Types {
363
361
  class craftjob extends Struct {
364
362
  ship_id: UInt64;
365
363
  workshop_id: UInt64;
366
- slot: UInt8;
367
364
  recipe_id: UInt16;
368
365
  quantity: UInt32;
369
366
  inputs: cargo_item[];
@@ -382,6 +379,7 @@ declare namespace Types {
382
379
  energy_paid: UInt32;
383
380
  cargo: cargo_item[];
384
381
  deposited: boolean;
382
+ arrives_at: TimePoint;
385
383
  }
386
384
  class craftjobs_result extends Struct {
387
385
  jobs: craftjob_row[];
@@ -393,22 +391,50 @@ declare namespace Types {
393
391
  amount_atomic: UInt64;
394
392
  node?: UInt32;
395
393
  }
394
+ class dbgjobs extends Struct {
395
+ crafts: craftjob_row[];
396
+ builds: buildjob_row[];
397
+ }
396
398
  class dbgmandate extends Struct {
397
399
  x: Int64;
398
400
  y: Int64;
399
401
  node_id: UInt32;
400
402
  }
401
- class dbgoldjobs extends Struct {
402
- crafts: craftjob_row[];
403
- builds: buildjob_row[];
404
- }
405
403
  class dbgpagerows extends Struct {
406
404
  rows: UInt32;
407
405
  }
406
+ class reserved_window extends Struct {
407
+ id: UInt64;
408
+ arrival: TimePoint;
409
+ starts_at: TimePoint;
410
+ completes_at: TimePoint;
411
+ }
412
+ class socket_candidate extends Struct {
413
+ windows: reserved_window[];
414
+ duration: UInt32;
415
+ active: UInt16;
416
+ }
417
+ class dbgpick extends Struct {
418
+ sockets: socket_candidate[];
419
+ id: UInt64;
420
+ arrival: TimePoint;
421
+ cap: UInt16;
422
+ }
423
+ class dbgplace extends Struct {
424
+ windows: reserved_window[];
425
+ id: UInt64;
426
+ arrival: TimePoint;
427
+ duration: UInt32;
428
+ }
408
429
  class dbgpurge extends Struct {
409
430
  table_name: Name;
410
431
  scope?: Name;
411
432
  }
433
+ class dbgrepack extends Struct {
434
+ windows: reserved_window[];
435
+ cancelled_id: UInt64;
436
+ now: TimePoint;
437
+ }
412
438
  class dbgseats extends Struct {
413
439
  x: Int64;
414
440
  y: Int64;
@@ -1012,6 +1038,7 @@ declare namespace Types {
1012
1038
  item_id: UInt16;
1013
1039
  kind: Name;
1014
1040
  display_label: string;
1041
+ base_capacity_fn: string;
1015
1042
  }
1016
1043
  class kind_meta_result extends Struct {
1017
1044
  kinds: kind_meta_row[];
@@ -1052,8 +1079,6 @@ declare namespace Types {
1052
1079
  node_id: UInt32;
1053
1080
  repeats: UInt16;
1054
1081
  }
1055
- class migratejobs extends Struct {
1056
- }
1057
1082
  class mint_threshold_view extends Struct {
1058
1083
  category: UInt8;
1059
1084
  tier: UInt8;
@@ -1234,6 +1259,9 @@ declare namespace Types {
1234
1259
  id: UInt64;
1235
1260
  name: string;
1236
1261
  }
1262
+ class repack_result extends Struct {
1263
+ windows: reserved_window[];
1264
+ }
1237
1265
  class resolve extends Struct {
1238
1266
  id: UInt64;
1239
1267
  count?: UInt64;
@@ -1362,6 +1390,11 @@ declare namespace Types {
1362
1390
  to_id: UInt64;
1363
1391
  items: cargo_item[];
1364
1392
  }
1393
+ class socket_pick extends Struct {
1394
+ found: boolean;
1395
+ socket: UInt8;
1396
+ window: reserved_window;
1397
+ }
1365
1398
  class standing_row extends Struct {
1366
1399
  account: Name;
1367
1400
  lifetime: UInt64;
@@ -1489,6 +1522,11 @@ declare namespace Types {
1489
1522
  x: Int64;
1490
1523
  y: Int64;
1491
1524
  }
1525
+ class window_receipt extends Struct {
1526
+ job_id: UInt64;
1527
+ starts_at: TimePoint;
1528
+ completes_at: TimePoint;
1529
+ }
1492
1530
  class wipe extends Struct {
1493
1531
  }
1494
1532
  class worlds_row extends Struct {