@shipload/sdk 1.0.0-next.55 → 1.0.0-next.57

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/shipload.d.ts CHANGED
@@ -3232,6 +3232,7 @@ interface CategoryStacks {
3232
3232
  declare function encodeStats(values: number[]): bigint;
3233
3233
  declare function decodeStat(stats: bigint, index: number): number;
3234
3234
  declare function decodeStats(stats: bigint, count: number): number[];
3235
+ declare function usedInputStatKeys(outputItemId: number): string[][];
3235
3236
  declare function decodeCraftedItemStats(itemId: number, stats: bigint): Record<string, number>;
3236
3237
  declare function blendStacks(stacks: StackInput[], statKey: string): number;
3237
3238
  declare function blendComponentStacks(stacks: {
@@ -4225,7 +4226,7 @@ declare function simulateRoute(movers: RouteMoverInput[], waypoints: {
4225
4226
  y: number;
4226
4227
  }, recharge: boolean): RouteSim;
4227
4228
 
4228
- type ModuleEntry$2 = Types.module_entry;
4229
+ type ModuleEntry$3 = Types.module_entry;
4229
4230
  type Lane = Types.lane;
4230
4231
  type Schedule = Types.schedule;
4231
4232
  interface ResolvedGathererLane {
@@ -4255,12 +4256,12 @@ interface ResolvedLoaderLane {
4255
4256
  valid: boolean;
4256
4257
  }
4257
4258
  declare function laneKeyForModule(slotIndex: number): number;
4258
- declare function resolveLaneGatherer(modules: ModuleEntry$2[], entityItemId: number, laneKey: number): ResolvedGathererLane;
4259
- declare function selectGatherLane(modules: ModuleEntry$2[], entityItemId: number, lanes: Lane[], stratum: number, explicitSlot?: number): number;
4260
- declare function resolveLaneCrafter(modules: ModuleEntry$2[], entityItemId: number, laneKey: number): ResolvedCrafterLane;
4261
- declare function resolveLaneBuilder(modules: ModuleEntry$2[], entityItemId: number, laneKey: number): ResolvedBuilderLane;
4262
- declare function resolveLaneLoader(modules: ModuleEntry$2[], entityItemId: number, laneKey: number): ResolvedLoaderLane;
4263
- declare function workerLaneKey(modules: ModuleEntry$2[], moduleSubtype: ModuleType, lanes: Lane[], stratum?: number): number;
4259
+ declare function resolveLaneGatherer(modules: ModuleEntry$3[], entityItemId: number, laneKey: number): ResolvedGathererLane;
4260
+ declare function selectGatherLane(modules: ModuleEntry$3[], entityItemId: number, lanes: Lane[], stratum: number, explicitSlot?: number): number;
4261
+ declare function resolveLaneCrafter(modules: ModuleEntry$3[], entityItemId: number, laneKey: number): ResolvedCrafterLane;
4262
+ declare function resolveLaneBuilder(modules: ModuleEntry$3[], entityItemId: number, laneKey: number): ResolvedBuilderLane;
4263
+ declare function resolveLaneLoader(modules: ModuleEntry$3[], entityItemId: number, laneKey: number): ResolvedLoaderLane;
4264
+ declare function workerLaneKey(modules: ModuleEntry$3[], moduleSubtype: ModuleType, lanes: Lane[], stratum?: number): number;
4264
4265
  declare function rawScheduleEnd(schedule: Schedule): Date;
4265
4266
  declare function candidateLaneCompletesAt(entity: ScheduleData, laneKey: number, durationSec: number, now: Date): Date;
4266
4267
 
@@ -4410,21 +4411,52 @@ type IdleResolveTarget = ScheduleData & {
4410
4411
  };
4411
4412
  declare function composeIdleResolve(blocker: IdleResolveTarget, action: Action, actions: ActionsManager, now: Date, lookupCounterpart?: CounterpartLookup): Action[];
4412
4413
 
4414
+ type Task = Types.task;
4415
+ type Coupling = Types.coupling;
4416
+ type CargoItem$2 = Types.cargo_item;
4417
+ type ModuleEntry$2 = Types.module_entry;
4418
+ interface CargoEffect {
4419
+ added: CargoItem$2[];
4420
+ removed: CargoItem$2[];
4421
+ }
4422
+ interface AvailabilityInput extends ScheduleData {
4423
+ cargo: CargoItem$2[];
4424
+ }
4425
+ interface CargoInput {
4426
+ itemId: number;
4427
+ stats: bigint;
4428
+ modules?: ModuleEntry$2[];
4429
+ quantity: number;
4430
+ }
4431
+ interface IncomingSource {
4432
+ holdId: string;
4433
+ until: Date;
4434
+ items: CargoItem$2[];
4435
+ }
4436
+ declare function calcCounterpartDelivery(task: Task, coupling: Coupling): CargoItem$2[];
4437
+ declare function taskCargoEffect(task: Task): CargoEffect;
4438
+ declare function cargoKey(item: CargoItem$2): string;
4439
+ declare function cargoInputKey(input: CargoInput): string;
4440
+ declare function projectedCargoAvailableAt(entity: AvailabilityInput, at: Date, incoming?: readonly IncomingSource[]): Map<string, bigint>;
4441
+ declare function cargoReadyAt(entity: AvailabilityInput, inputs: readonly CargoInput[], incoming?: readonly IncomingSource[]): Date;
4442
+ declare function availableForItem(avail: Map<string, bigint>, itemId: number): bigint;
4443
+
4413
4444
  declare enum CancelBlockReason {
4414
4445
  TASK_NEVER = "TASK_NEVER",
4415
4446
  BEFORE_START_RUNNING = "BEFORE_START_RUNNING",
4416
4447
  DONE = "DONE",
4417
4448
  CONTAINS_LINKED_TASK = "CONTAINS_LINKED_TASK",
4418
4449
  WOULD_STRAND = "WOULD_STRAND",
4450
+ WOULD_STRAND_COUNTERPART = "WOULD_STRAND_COUNTERPART",
4419
4451
  WOULD_OVERFILL = "WOULD_OVERFILL",
4420
4452
  NOT_OWNER = "NOT_OWNER"
4421
4453
  }
4422
4454
  type EntityInfo = InstanceType<typeof Types.entity_info>;
4423
4455
  type EntityRef = InstanceType<typeof Types.entity_ref>;
4424
- type CargoItem$2 = InstanceType<typeof Types.cargo_item>;
4456
+ type CargoItem$1 = InstanceType<typeof Types.cargo_item>;
4425
4457
  interface CancelRefund {
4426
4458
  giver: EntityRef;
4427
- cargo: CargoItem$2[];
4459
+ cargo: CargoItem$1[];
4428
4460
  }
4429
4461
  interface CancelReleasedHold {
4430
4462
  counterpart: EntityRef;
@@ -4442,6 +4474,7 @@ interface CancelEffects {
4442
4474
  interface CancelPlan {
4443
4475
  ok: boolean;
4444
4476
  blockedReason?: CancelBlockReason;
4477
+ blockedByCounterpart?: EntityRef;
4445
4478
  range: {
4446
4479
  count: number;
4447
4480
  taskIndices: number[];
@@ -4451,6 +4484,7 @@ interface CancelPlan {
4451
4484
  interface CancelEligibilityInput {
4452
4485
  now: Date;
4453
4486
  counterparts?: Map<string, EntityInfo>;
4487
+ counterpartIncoming?: Map<string, readonly IncomingSource[]>;
4454
4488
  }
4455
4489
  declare function cancelEligibility(entity: EntityInfo, laneKey: number, fromTaskIndex: number, input: CancelEligibilityInput): CancelPlan;
4456
4490
 
@@ -4520,27 +4554,13 @@ declare function receiveFits(dest: UnwrapDestination & ScheduleData & {
4520
4554
  }[];
4521
4555
  }, item: UnwrapItem, now: Date): boolean;
4522
4556
 
4523
- type Task = Types.task;
4524
- type CargoItem$1 = Types.cargo_item;
4525
- interface CargoEffect {
4526
- added: CargoItem$1[];
4527
- removed: CargoItem$1[];
4528
- }
4529
- interface AvailabilityInput extends ScheduleData {
4530
- cargo: CargoItem$1[];
4531
- }
4532
- declare function taskCargoEffect(task: Task): CargoEffect;
4533
- declare function projectedCargoAvailableAt(entity: AvailabilityInput, at: Date): Map<string, bigint>;
4534
- declare function cargoReadyAt(entity: AvailabilityInput, inputItemIds: readonly number[]): Date;
4535
- declare function availableForItem(avail: Map<string, bigint>, itemId: number): bigint;
4536
-
4537
4557
  type CargoItem = Types.cargo_item;
4538
4558
  type ModuleEntry$1 = Types.module_entry;
4539
4559
  interface CraftableEntity extends ScheduleData {
4540
4560
  cargo: CargoItem[];
4541
4561
  modules: ModuleEntry$1[];
4542
4562
  }
4543
- declare function maxCraftable(entity: CraftableEntity, recipe: Recipe, crafterSpeed: number, now: Date): number;
4563
+ declare function maxCraftable(entity: CraftableEntity, recipe: Recipe, crafterSpeed: number, now: Date, incoming?: readonly IncomingSource[]): number;
4544
4564
 
4545
4565
  declare function energyAtTime(entity: Projectable, now: Date): number;
4546
4566
 
@@ -5449,4 +5469,4 @@ type entity_row = Types.entity_row;
5449
5469
  type location_static = Types.location_static;
5450
5470
  type location_derived = Types.location_derived;
5451
5471
 
5452
- export { ALL_ENTITY_TYPES, ATOMICASSETS_ACCOUNT, AckMessage, ActionsManager, AnyEntity, AtomicAssetRow, AtomicAttributeType, AtomicSchemaRow, BASE_HAUL_PENALTY_MILLI, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, BroadEntitySubscriptionFilter, BuildGatherPlanOpts, BuildMethod, BuildState, BuildableTarget, BuilderStats, CANCEL_CONTAINS_GROUPED_TASK, CAPACITY_TIER_TABLE, CAP_DEMOLISH, CAP_MODULES, CAP_UNDEPLOY, CAP_WRAP, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, COMPONENT_TIER_PREFIXES, CONTAINER_NOT_FOUND, CONTAINER_Z, COORD_MAX, COORD_MIN, COORD_OFFSET, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CancelBlockReason, CancelEffects, CancelEligibilityInput, CancelPlan, CancelRefund, CancelReleasedHold, CapabilityAttribute, CapabilityAttributeRow, CapabilityInput, CargoData, CargoMassInfo, CargoStack, CategoryInfo, CategoryStacks, ClientMessage, Cluster, ClusterCell, ClusterCellWire, ClusterDeltaMessage, ClusterManager, ClusterSlotType, ComputedCapabilities, ConnectionState, ConstructionManager, Container, ContainerEntity, Coord, CoordinateAddress, Coordinates, CoordinatesType, CounterpartLookup, CraftedItemCategory, CrafterCapability, CrafterStats, DEFAULT_BASE_HULLMASS, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DecodedAtomicAsset, DemandRow, DerivedLoaders, DerivedStratum, DescribeOptions, DisplayNameResult, Distance, ENGINE_DRAIN_BASE, ENGINE_DRAIN_REF_THM, ENGINE_DRAIN_REF_THRUST, ENTITY_ALREADY_THERE, ENTITY_CAPACITY_EXCEEDED, ENTITY_CARGO_NOT_LOADED, ENTITY_CARGO_NOT_OWNED, ENTITY_CONSTRUCTION_DOCK, ENTITY_CONTAINER, ENTITY_EXTRACTOR, ENTITY_FACTORY, ENTITY_HUB, ENTITY_INVALID_CARGO, ENTITY_INVALID_DESTINATION, ENTITY_INVALID_TRAVEL_DURATION, ENTITY_NEXUS, ENTITY_NOT_ENOUGH_ENERGY, ENTITY_NOT_ENOUGH_ENERGY_CAPACITY, ENTITY_NO_CRAFTER, ENTITY_SHIP, ENTITY_WAREHOUSE, ENTITY_WORKSHOP, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EffectiveReserveInput, EnergyCapability, EntitiesManager, EntitiesSubscriptionHandle, Entity$1 as Entity, EntityCapabilities, EntityClass, EntityDeletedMessage, EntityInfo$2 as EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntityStateInput, EntitySubscriptionFilter, EntitySubscriptionHandle, EntitySubscriptionHandlers, EntitySubscriptionMeta, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, ExactEntitySubscriptionFilter, Extractor, Factory, FetchAssetsOptions, FillCap, FinalizerCapability, FinalizerEntityRef, FloatPosition, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHERER_DEPTH_MAX_TIER, GATHERER_DEPTH_TABLE, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_MASS_DIVISOR, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GatherCycle, GatherLimpet, GatherPlan, GatherPlanEntity, GathererCapability, GathererDepthParams, GathererStats, GridCell, HAULER_EFFICIENCY_DENOM, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, HoldKind, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BATTERY_T1, ITEM_BEAM, ITEM_BEAM_T2, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_BUILDER_T1, ITEM_CERAMIC, ITEM_CERAMIC_T2, ITEM_CONSTRUCTION_DOCK_T1_PACKED, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_DREDGER_T1_PACKED, ITEM_ENGINE_T1, ITEM_EXTRACTOR_T1_PACKED, ITEM_FACTORY_T1_PACKED, ITEM_FRAME, ITEM_FRAME_T2, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GATHERER_T2, ITEM_GENERATOR_T1, ITEM_HAULER_SHIP_T2_PACKED, ITEM_HAULER_T1, ITEM_HAULER_T2, ITEM_HUB_T1_PACKED, ITEM_LAUNCHER_T1, ITEM_LOADER_T1, ITEM_MASS_CATCHER_T1_PACKED, ITEM_MASS_DRIVER_T1_PACKED, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_PLASMA_CELL, ITEM_PLASMA_CELL_T2, ITEM_PLATE, ITEM_PLATE_T2, ITEM_POLYMER, ITEM_POLYMER_T2, ITEM_PORTER_T1_PACKED, ITEM_PROSPECTOR_T1_PACKED, ITEM_PROSPECTOR_T2_PACKED, ITEM_REACTOR, ITEM_REACTOR_T2, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_RESIN, ITEM_RESIN_T2, ITEM_RESONATOR, ITEM_RESONATOR_T2, ITEM_ROUSTABOUT_T1_PACKED, ITEM_SENSOR, ITEM_SENSOR_T2, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_TENDER_T1_PACKED, ITEM_TUG_T1_PACKED, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, ITEM_WARP_T1, ITEM_WORKSHOP_T1_PACKED, ITEM_WRANGLER_T1_PACKED, ITEM_WRIGHT_T1_PACKED, IdleResolveTarget, ImmutableEntry, ImmutableModuleSlot, InboundTransfer, InstalledModule, InventoryAccessor, Item, ItemType, JOB_QUEUE_CAP, JobLane, JobLaneEntry, JobWindow, KindMeta, LANE_BARRIER, LANE_MOBILITY, LOCAL_HALF, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LanePlanEntry, LaneView, LaunchNumericInput, LaunchQuote, LaunchQuoteCatcher, LaunchQuoteLauncher, LaunchStatsInput, LoadTimeBreakdown, LoaderCapability, LoaderStats, Location, LocationStratum, LocationType, LocationsManager, MAX_LEGS, MAX_ORBITAL_ALTITUDE, MAX_STARS_PER_STAT, MAX_STAR_RATING, MIN_ORBITAL_ALTITUDE, MIN_TRANSFER_DISTANCE_ORBITAL_VESSEL, MIN_TRANSFER_DISTANCE_PLANETARY_STRUCTURE, MODULE_ANY, MODULE_BATTERY, MODULE_BUILDER, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STAT_SCALING_ANCHOR, MODULE_STAT_SCALING_POST_ANCHOR_PERCENT, MODULE_STORAGE, MODULE_TIER_PREFIXES, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, MintAssetParams, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, Neighbor, Nexus, NftConfigForItem, NftManager, OrderedTask, OwnerSubscriptionHandle, PLANETARY_STRUCTURE_Z, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanRouteParams, PlanTarget, PlanetSubtypeInfo, platform as PlatformContract, Types$1 as PlatformTypes, Player, PlayerRosterEntry, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REGION_DIV, REGION_PER_AXIS, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, RESOURCE_TIER_ADJECTIVES, RESOURCE_TIER_MULT_TENTHS, RawData, ReachStats, Recipe, RecipeConsumer, RecipeInput, RecipeSlotInput, RefitOp, RenderDescriptionOptions, Reservation, ReserveTier, ResolvedAttributeGroup, ResolvedCrafterLane, ResolvedEvent, ResolvedGathererLane, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedLoaderLane, ResolvedModuleSlot, ResourceCategory, ResourceDemand, ResourceStats, RouteFailure, RouteFailureReason, RouteHeuristicCost, RouteLegCost, RouteLegInput, RouteLegSim, RouteMoverInput, RoutePlan, RouteResult, RouteSim, SECTORS_PER_AXIS, SECTOR_DIV, SHIPLOAD_COLLECTION, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_NOT_ARRIVED, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, SLOT_FORMULAS, STAR_STEP, ScanProvider, ScheduleAccessor, ScheduleCapability, ScheduleData, ScheduledBuild, SchemaField, server as ServerContract, ServerMessage, Types as ServerTypes, Ship, ShipEntity, ShipLike, Shipload, SlotConsumer, SlotConsumerKind, SnapshotMessage, SourceCargoStack, SourceEntityRef, StackInput, StarSortable, StatDefinition, StatFlow, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, SystemGraph, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskCargoChange, TaskCargoDirection, TaskType, TemplateMeta, TextSpan, TierRange, TransferEntity, TravelDrainBreakdown, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UnwrapDestination, UnwrapItem, UpdateBoundsMessage, UpdateMessage, ValidateDisplayNameOptions, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_NOT_FOUND, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, WH, WOULD_OVERFILL, WOULD_STRAND, Warehouse, WarehouseEntity, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, WrapDeposit, YIELD_FRACTION_DEEP, YIELD_FRACTION_SHALLOW, addressFromCoordinates, allBuildableItems, allPlotBuildableItems, allocateProportional, applyCapacityTier, applyResourceTierMultiplier, availableBuildMethods, availableCapacity$1 as availableCapacity, availableCapacityFromMass, availableForItem, baseName, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildComponentImmutable, buildEntityDescription, buildEntityImmutable, buildGatherPlan, buildImmutableData, buildMintAssetAction, buildModuleImmutable, buildResourceImmutable, calcCargoItemMass, calcCargoMass, calcEnergyUsage, calcStacksMass, calc_acceleration, calc_build_duration, calc_build_energy, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_gather_rate, calc_group_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_onesided_duration, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calc_transit_duration, calc_travel_flighttime, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, cancelEligibility, candidateLaneCompletesAt, capabilityAttributes, capabilityNames, capacityTierMultiplier, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLauncher, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoItem, cargoItemToStack, cargoReadyAt, cargoRef, cargoUtils, cargo_item, categoryColors, categoryFromIndex, categoryLabel, categoryLabelFromIndex, compareByStars, componentIcon, composeIdleResolve, computeBaseCapacity, computeBaseCapacityContainer, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeBatteryCapabilities, computeBuilderCapabilities, computeBuilderDrain, computeBuilderSpeed, computeComponentStats, computeContainerCapabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEffectiveModuleStat, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityCapabilities, computeEntityStats, computeFreeCells, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeGroupPerLegReach, computeHaulPenalty, computeHaulerCapabilities, computeHaulerCapacity, computeHaulerEfficiency, computeInputMass, computeLauncherCapabilities, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeNftImageUrl, computePerLegReach, computeShipHullCapabilities, computeStorageCapabilities, computeTravelDrain, computeWarehouseHullCapabilities, computeWarpCapabilities, computeWarpRange, coordsToLocationId, coupling, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeAddress, decodeAtomicAsset, decodeCraftedItemStats, decodeRegion, decodeSector, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStatMappings, deriveStrata, deriveStratum, derivedLoaders, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeAtomicData, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, easeFlightProgress, eligibleUpgrades, encodeAddress, encodeAddressMemo, encodeGatheredCargoStats, encodeRegion, encodeSector, encodeStats, energyAtTime, energyPercent, energy_stats, entityDisplayName, entity_row, estimateDealTravelTime, estimateTravelTime, estimateUnwrapDuration, feistel, feistelInv, fetchAtomicAssetsForOwner, fetchAtomicSchemas, filterByBuildMethod, findNearbyPlanets, flightSpeedFactor, formatLocation, formatMass, formatMassDelta, formatMassScaled, formatModuleLine, formatTier, gatherEnergyCost, gathererDepthForTier, getAllRecipes, getBaseHullmassFor, getCapabilityAttributeRows, getCapabilityAttributes, getCategoryInfo, getComponentDemand, getComponents, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEffectiveReserve, getEligibleResources, getEntityClass, getEntityItems, getEntityLayout, getEpochInfo, getFlightOrigin, getInterpolatedPosition, getItem, getItems, getKindMeta, getLocationCandidates, getLocationKind, getLocationProfile, getLocationType, getLocationTypeName, getModuleCapabilityType, getModules, getPackedEntityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getProducersForAttribute, getRecipe, getRecipeConsumers, getResourceDemand, getResourceTier, getResourceWeight, getResources, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, getTemplateMeta, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, incomingHoldMass, interpolateFlightPosition, isBuildable, isConstructionDock, isContainer, isCraftedItem, isExtractor, isFactory, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isHub, isInvertedAttribute, isLocationBuildable, isModuleItem, isNexus, isPlot, isPlotBuildable, isRelatedItem, isShip, isSubscriptionsDebugEnabled, isValidWormholePair, isWarehouse, isWorkshop, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, jobsToLanes, kindCan, lane, laneKeyForModule, lerp, location_derived, location_static, makeEntity, mapEntity, maxCraftable, maxQtyForCharge, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, nearbyWormholes, needsRecharge, normalizeDisplayName, parseWireEntity, partnerRegion, pickFabricator, planParallelTransfer, planRoute, projectEntity, projectEntityAt, projectRemainingAt, projectedCargoAvailableAt, projectedPeakCargomass, rawScheduleEnd, readCommonBase, receiveFits, regionOf, removeFromStacks, renderDescription, resolveItem, resolveItemCategory, resolveLaneBuilder, resolveLaneCrafter, resolveLaneGatherer, resolveLaneLoader, resolveLockedAmount, resolveStats, rollTier, rollWithinTier, rollupBuilder, rollupCrafter, rollupGatherer, rollupLoaders, rotation, schedule, sdkSystemGraph, selectGatherLane, setSubscriptionsDebug, simulateRoute, slotAcceptsModule, socketTail, sourceLabelForOutput, splitCost, stackKey, stackToCargoItem, stacksEqual, starRating, starsForStat, statMagnitude, subtractFromStacks, task, taskCargoChanges, taskCargoEffect, tierAdjective, tierColors, tierOfReserve, toLocation, typeLabel, unwrapLoadDuration, unwrapTransitDuration, validateDisplayName, validateSchedule, workerLaneKey, wormholeAt, wormholeAtRegionEndpoint, yieldThresholdAt };
5472
+ export { ALL_ENTITY_TYPES, ATOMICASSETS_ACCOUNT, AckMessage, ActionsManager, AnyEntity, AtomicAssetRow, AtomicAttributeType, AtomicSchemaRow, BASE_HAUL_PENALTY_MILLI, BASE_ORBITAL_MASS, BLEND_INPUTS_MUST_MATCH, BLEND_REQUIRES_MULTIPLE, BLEND_STAT_LESS_NOT_SUPPORTED, BoundingBox, BoundsDeltaMessage, BoundsSubscriptionHandle, BroadEntitySubscriptionFilter, BuildGatherPlanOpts, BuildMethod, BuildState, BuildableTarget, BuilderStats, CANCEL_CONTAINS_GROUPED_TASK, CAPACITY_TIER_TABLE, CAP_DEMOLISH, CAP_MODULES, CAP_UNDEPLOY, CAP_WRAP, CATEGORY_LABELS, COMMIT_ALREADY_SET, COMMIT_CANNOT_MATCH, COMMIT_NOT_SET, COMPANY_NOT_FOUND, COMPONENT_TIER_PREFIXES, CONTAINER_NOT_FOUND, CONTAINER_Z, COORD_MAX, COORD_MIN, COORD_OFFSET, CRAFT_ENERGY_DIVISOR, CRAFT_EXCEEDS_ENERGY_CAPACITY, CRAFT_NOT_ENOUGH_ENERGY, CancelBlockReason, CancelEffects, CancelEligibilityInput, CancelPlan, CancelRefund, CancelReleasedHold, CapabilityAttribute, CapabilityAttributeRow, CapabilityInput, CargoData, CargoInput, CargoMassInfo, CargoStack, CategoryInfo, CategoryStacks, ClientMessage, Cluster, ClusterCell, ClusterCellWire, ClusterDeltaMessage, ClusterManager, ClusterSlotType, ComputedCapabilities, ConnectionState, ConstructionManager, Container, ContainerEntity, Coord, CoordinateAddress, Coordinates, CoordinatesType, CounterpartLookup, CraftedItemCategory, CrafterCapability, CrafterStats, DEFAULT_BASE_HULLMASS, DEPLOY_ENTITY_HAS_SCHEDULE, DEPTH_THRESHOLD_T1, DEPTH_THRESHOLD_T2, DEPTH_THRESHOLD_T3, DEPTH_THRESHOLD_T4, DEPTH_THRESHOLD_T5, DESTINATION_CAPACITY_EXCEEDED, DecodedAtomicAsset, DemandRow, DerivedLoaders, DerivedStratum, DescribeOptions, DisplayNameResult, Distance, ENGINE_DRAIN_BASE, ENGINE_DRAIN_REF_THM, ENGINE_DRAIN_REF_THRUST, ENTITY_ALREADY_THERE, ENTITY_CAPACITY_EXCEEDED, ENTITY_CARGO_NOT_LOADED, ENTITY_CARGO_NOT_OWNED, ENTITY_CONSTRUCTION_DOCK, ENTITY_CONTAINER, ENTITY_EXTRACTOR, ENTITY_FACTORY, ENTITY_HUB, ENTITY_INVALID_CARGO, ENTITY_INVALID_DESTINATION, ENTITY_INVALID_TRAVEL_DURATION, ENTITY_NEXUS, ENTITY_NOT_ENOUGH_ENERGY, ENTITY_NOT_ENOUGH_ENERGY_CAPACITY, ENTITY_NO_CRAFTER, ENTITY_SHIP, ENTITY_WAREHOUSE, ENTITY_WORKSHOP, EPOCH_NON_ZERO, EPOCH_NOT_READY, ERROR_SYSTEM_ALREADY_INITIALIZED, ERROR_SYSTEM_DISABLED, ERROR_SYSTEM_NOT_INITIALIZED, EffectiveReserveInput, EnergyCapability, EntitiesManager, EntitiesSubscriptionHandle, Entity$1 as Entity, EntityCapabilities, EntityClass, EntityDeletedMessage, EntityInfo$2 as EntityInfo, EntityInstance, EntityInventory, EntityLayout, EntityRefInput, EntitySlot, EntityState, EntityStateInput, EntitySubscriptionFilter, EntitySubscriptionHandle, EntitySubscriptionHandlers, EntitySubscriptionMeta, EntityTypeName, EpochInfo, EpochsManager, ErrorMessage, EstimateTravelTimeOptions, EstimatedTravelTime, EventCatchupCompleteMessage, EventMessage, ExactEntitySubscriptionFilter, Extractor, Factory, FetchAssetsOptions, FillCap, FinalizerCapability, FinalizerEntityRef, FloatPosition, GAME_NOT_FOUND, GAME_SEED_NOT_SET, GATHERER_DEPTH_MAX_TIER, GATHERER_DEPTH_TABLE, GATHER_EXCEEDS_ENERGY_CAPACITY, GATHER_MASS_DIVISOR, GATHER_NOT_ENOUGH_ENERGY, GROUP_DUPLICATE_ENTITY, GROUP_EMPTY, GROUP_ENTITY_NOT_MOVABLE, GROUP_HAUL_CAPACITY_EXCEEDED, GROUP_NOT_FOUND, GROUP_NOT_SAME_LOCATION, GROUP_NOT_SAME_OWNER, GROUP_NO_THRUST, GameState, GatherCycle, GatherLimpet, GatherPlan, GatherPlanEntity, GathererCapability, GathererDepthParams, GathererStats, GridCell, HAULER_EFFICIENCY_DENOM, HasCapacity, HasCargo, HasCargomass, HasScheduleAndLocation, HoldKind, INSUFFICIENT_BALANCE, INSUFFICIENT_ITEM_QUANTITY, INSUFFICIENT_ITEM_SUPPLY, INVALID_AMOUNT, ITEM_BATTERY_T1, ITEM_BEAM, ITEM_BEAM_T2, ITEM_BIOMASS_T1, ITEM_BIOMASS_T10, ITEM_BIOMASS_T2, ITEM_BIOMASS_T3, ITEM_BIOMASS_T4, ITEM_BIOMASS_T5, ITEM_BIOMASS_T6, ITEM_BIOMASS_T7, ITEM_BIOMASS_T8, ITEM_BIOMASS_T9, ITEM_BUILDER_T1, ITEM_CERAMIC, ITEM_CERAMIC_T2, ITEM_CONSTRUCTION_DOCK_T1_PACKED, ITEM_CONTAINER_T1_PACKED, ITEM_CONTAINER_T2_PACKED, ITEM_CRAFTER_T1, ITEM_CRYSTAL_T1, ITEM_CRYSTAL_T10, ITEM_CRYSTAL_T2, ITEM_CRYSTAL_T3, ITEM_CRYSTAL_T4, ITEM_CRYSTAL_T5, ITEM_CRYSTAL_T6, ITEM_CRYSTAL_T7, ITEM_CRYSTAL_T8, ITEM_CRYSTAL_T9, ITEM_DOES_NOT_EXIST, ITEM_DREDGER_T1_PACKED, ITEM_ENGINE_T1, ITEM_EXTRACTOR_T1_PACKED, ITEM_FACTORY_T1_PACKED, ITEM_FRAME, ITEM_FRAME_T2, ITEM_GAS_T1, ITEM_GAS_T10, ITEM_GAS_T2, ITEM_GAS_T3, ITEM_GAS_T4, ITEM_GAS_T5, ITEM_GAS_T6, ITEM_GAS_T7, ITEM_GAS_T8, ITEM_GAS_T9, ITEM_GATHERER_T1, ITEM_GATHERER_T2, ITEM_GENERATOR_T1, ITEM_HAULER_SHIP_T2_PACKED, ITEM_HAULER_T1, ITEM_HAULER_T2, ITEM_HUB_T1_PACKED, ITEM_LAUNCHER_T1, ITEM_LOADER_T1, ITEM_MASS_CATCHER_T1_PACKED, ITEM_MASS_DRIVER_T1_PACKED, ITEM_NOT_AVAILABLE_AT_LOCATION, ITEM_NOT_DEPLOYABLE, ITEM_NOT_PACKED_ENTITY, ITEM_ORE_T1, ITEM_ORE_T10, ITEM_ORE_T2, ITEM_ORE_T3, ITEM_ORE_T4, ITEM_ORE_T5, ITEM_ORE_T6, ITEM_ORE_T7, ITEM_ORE_T8, ITEM_ORE_T9, ITEM_PLASMA_CELL, ITEM_PLASMA_CELL_T2, ITEM_PLATE, ITEM_PLATE_T2, ITEM_POLYMER, ITEM_POLYMER_T2, ITEM_PORTER_T1_PACKED, ITEM_PROSPECTOR_T1_PACKED, ITEM_PROSPECTOR_T2_PACKED, ITEM_REACTOR, ITEM_REACTOR_T2, ITEM_REGOLITH_T1, ITEM_REGOLITH_T10, ITEM_REGOLITH_T2, ITEM_REGOLITH_T3, ITEM_REGOLITH_T4, ITEM_REGOLITH_T5, ITEM_REGOLITH_T6, ITEM_REGOLITH_T7, ITEM_REGOLITH_T8, ITEM_REGOLITH_T9, ITEM_RESIN, ITEM_RESIN_T2, ITEM_RESONATOR, ITEM_RESONATOR_T2, ITEM_ROUSTABOUT_T1_PACKED, ITEM_SENSOR, ITEM_SENSOR_T2, ITEM_SHIP_T1_PACKED, ITEM_STORAGE_T1, ITEM_TENDER_T1_PACKED, ITEM_TUG_T1_PACKED, ITEM_TYPE_COMPONENT, ITEM_TYPE_ENTITY, ITEM_TYPE_MODULE, ITEM_TYPE_RESOURCE, ITEM_WAREHOUSE_T1_PACKED, ITEM_WARP_T1, ITEM_WORKSHOP_T1_PACKED, ITEM_WRANGLER_T1_PACKED, ITEM_WRIGHT_T1_PACKED, IdleResolveTarget, ImmutableEntry, ImmutableModuleSlot, InboundTransfer, IncomingSource, InstalledModule, InventoryAccessor, Item, ItemType, JOB_QUEUE_CAP, JobLane, JobLaneEntry, JobWindow, KindMeta, LANE_BARRIER, LANE_MOBILITY, LOCAL_HALF, LOCATION_MAX_DEPTH, LOCATION_MIN_DEPTH, LanePlanEntry, LaneView, LaunchNumericInput, LaunchQuote, LaunchQuoteCatcher, LaunchQuoteLauncher, LaunchStatsInput, LoadTimeBreakdown, LoaderCapability, LoaderStats, Location, LocationStratum, LocationType, LocationsManager, MAX_LEGS, MAX_ORBITAL_ALTITUDE, MAX_STARS_PER_STAT, MAX_STAR_RATING, MIN_ORBITAL_ALTITUDE, MIN_TRANSFER_DISTANCE_ORBITAL_VESSEL, MIN_TRANSFER_DISTANCE_PLANETARY_STRUCTURE, MODULE_ANY, MODULE_BATTERY, MODULE_BUILDER, MODULE_CARGO_NOT_FOUND, MODULE_CRAFTER, MODULE_ENGINE, MODULE_ENTITY_BUSY, MODULE_GATHERER, MODULE_GENERATOR, MODULE_HAULER, MODULE_LAUNCHER, MODULE_LOADER, MODULE_NOT_MODULE, MODULE_SLOT_EMPTY, MODULE_SLOT_INVALID, MODULE_SLOT_OCCUPIED, MODULE_STAT_SCALING_ANCHOR, MODULE_STAT_SCALING_POST_ANCHOR_PERCENT, MODULE_STORAGE, MODULE_TIER_PREFIXES, MODULE_TYPE_MISMATCH, MODULE_WARP, MassCapability, MintAssetParams, ModuleDescription, ModuleEntry, ModuleType, MovementCapability, index as NFT, NFTCargoItem, NFTCommonBase, NFTInstalledModule, NFTModuleSlot, NO_SCHEDULE, NamedStats, Neighbor, Nexus, NftConfigForItem, NftManager, OrderedTask, OwnerSubscriptionHandle, PLANETARY_STRUCTURE_Z, PLANET_SUBTYPE_GAS_GIANT, PLANET_SUBTYPE_ICY, PLANET_SUBTYPE_INDUSTRIAL, PLANET_SUBTYPE_OCEAN, PLANET_SUBTYPE_ROCKY, PLANET_SUBTYPE_TERRESTRIAL, PLAYER_ALREADY_JOINED, PLAYER_NOT_FOUND, PLAYER_NOT_JOINED, PRECISION, PackedModule, PackedModuleInput, PingMessage, PlanRouteParams, PlanTarget, PlanetSubtypeInfo, platform as PlatformContract, Types$1 as PlatformTypes, Player, PlayerRosterEntry, PlayerStateInput, PlayersManager, PongMessage, Projectable, ProjectedEntity, ProjectionOptions, RECIPE_INPUTS_EXCESS, RECIPE_INPUTS_INSUFFICIENT, RECIPE_INPUTS_INVALID, RECIPE_INPUTS_MIXED, RECIPE_NOT_FOUND, REGION_DIV, REGION_PER_AXIS, REQUIRES_MORE_THAN_ONE, REQUIRES_POSITIVE_VALUE, RESERVE_TIERS, RESOLVE_COUNT_EXCEEDS_COMPLETED, RESOURCE_TIER_ADJECTIVES, RESOURCE_TIER_MULT_TENTHS, RawData, ReachStats, Recipe, RecipeConsumer, RecipeInput, RecipeSlotInput, RefitOp, RenderDescriptionOptions, Reservation, ReserveTier, ResolvedAttributeGroup, ResolvedCrafterLane, ResolvedEvent, ResolvedGathererLane, ResolvedItem, ResolvedItemStat, ResolvedItemType, ResolvedLoaderLane, ResolvedModuleSlot, ResourceCategory, ResourceDemand, ResourceStats, RouteFailure, RouteFailureReason, RouteHeuristicCost, RouteLegCost, RouteLegInput, RouteLegSim, RouteMoverInput, RoutePlan, RouteResult, RouteSim, SECTORS_PER_AXIS, SECTOR_DIV, SHIPLOAD_COLLECTION, SHIP_ALREADY_TRAVELING, SHIP_CANNOT_BUY_TRAVELING, SHIP_CANNOT_CANCEL_TASK, SHIP_CANNOT_UPDATE_TRAVELING, SHIP_NOT_ARRIVED, SHIP_NOT_FOUND, SHIP_NOT_IDLE, SHIP_NOT_OWNED, SHIP_NO_COMPLETED_TASKS, SHIP_NO_TASKS_TO_CANCEL, SLOT_FORMULAS, STAR_STEP, ScanProvider, ScheduleAccessor, ScheduleCapability, ScheduleData, ScheduledBuild, SchemaField, server as ServerContract, ServerMessage, Types as ServerTypes, Ship, ShipEntity, ShipLike, Shipload, SlotConsumer, SlotConsumerKind, SnapshotMessage, SourceCargoStack, SourceEntityRef, StackInput, StarSortable, StatDefinition, StatFlow, StatMapping, StatSlot, StorageCapability, StratumInfo, SubscribeEntityMessage, SubscribeEventsMessage, SubscribeMessage, SubscriptionEntityType, SubscriptionsManager, SubscriptionsOptions, SystemGraph, TIER_ROLL_MAX, TRAVEL_MAX_DURATION, TaskCancelable, TaskCargoChange, TaskCargoDirection, TaskType, TemplateMeta, TextSpan, TierRange, TransferEntity, TravelDrainBreakdown, UnsubscribeEntityMessage, UnsubscribeEventsMessage, UnsubscribeMessage, UnwrapDestination, UnwrapItem, UpdateBoundsMessage, UpdateMessage, ValidateDisplayNameOptions, WAREHOUSE_ALREADY_AT_LOCATION, WAREHOUSE_NOT_FOUND, WARP_HAS_CARGO, WARP_HAS_SCHEDULE, WARP_NOT_FULL_ENERGY, WARP_NO_CAPABILITY, WARP_OUT_OF_RANGE, WH, WOULD_OVERFILL, WOULD_STRAND, Warehouse, WarehouseEntity, WebSocketConnection, WebSocketConnectionOptions, WireCoordinates, WireEntity, WrapDeposit, YIELD_FRACTION_DEEP, YIELD_FRACTION_SHALLOW, addressFromCoordinates, allBuildableItems, allPlotBuildableItems, allocateProportional, applyCapacityTier, applyResourceTierMultiplier, availableBuildMethods, availableCapacity$1 as availableCapacity, availableCapacityFromMass, availableForItem, baseName, blendCargoStacks, blendComponentStacks, blendCrossGroup, blendStacks, buildComponentImmutable, buildEntityDescription, buildEntityImmutable, buildGatherPlan, buildImmutableData, buildMintAssetAction, buildModuleImmutable, buildResourceImmutable, calcCargoItemMass, calcCargoMass, calcCounterpartDelivery, calcEnergyUsage, calcStacksMass, calc_acceleration, calc_build_duration, calc_build_energy, calc_craft_duration, calc_craft_energy, calc_energyusage, calc_flighttime, calc_gather_duration, calc_gather_energy, calc_gather_rate, calc_group_flighttime, calc_loader_acceleration, calc_loader_flighttime, calc_onesided_duration, calc_orbital_altitude, calc_rechargetime, calc_ship_acceleration, calc_ship_flighttime, calc_ship_mass, calc_ship_rechargetime, calc_transfer_duration, calc_transit_duration, calc_travel_flighttime, calculateFlightTime, calculateLoadTimeBreakdown, calculateRefuelingTime, calculateTransferTime, canMove, cancelEligibility, candidateLaneCompletesAt, capabilityAttributes, capabilityNames, capacityTierMultiplier, capsHasCrafter, capsHasGatherer, capsHasHauler, capsHasLauncher, capsHasLoaders, capsHasMass, capsHasMovement, capsHasStorage, cargoInputKey, cargoItem, cargoItemToStack, cargoKey, cargoReadyAt, cargoRef, cargoUtils, cargo_item, categoryColors, categoryFromIndex, categoryLabel, categoryLabelFromIndex, compareByStars, componentIcon, composeIdleResolve, computeBaseCapacity, computeBaseCapacityContainer, computeBaseCapacityShip, computeBaseCapacityWarehouse, computeBaseHullmass, computeBatteryCapabilities, computeBuilderCapabilities, computeBuilderDrain, computeBuilderSpeed, computeComponentStats, computeContainerCapabilities, computeCraftedOutputStats, computeCrafterCapabilities, computeCrafterDrain, computeCrafterSpeed, computeEffectiveModuleStat, computeEngineCapabilities, computeEngineDrain, computeEngineThrust, computeEntityCapabilities, computeEntityStats, computeFreeCells, computeGathererCapabilities, computeGathererDepth, computeGathererDrain, computeGathererYield, computeGeneratorCap, computeGeneratorCapabilities, computeGeneratorRech, computeGroupPerLegReach, computeHaulPenalty, computeHaulerCapabilities, computeHaulerCapacity, computeHaulerEfficiency, computeInputMass, computeLauncherCapabilities, computeLoaderCapabilities, computeLoaderMass, computeLoaderThrust, computeNftImageUrl, computePerLegReach, computeShipHullCapabilities, computeStorageCapabilities, computeTravelDrain, computeWarehouseHullCapabilities, computeWarpCapabilities, computeWarpRange, coordsToLocationId, coupling, createInventoryAccessor, createProjectedEntity, createScheduleAccessor, decodeAddress, decodeAtomicAsset, decodeCraftedItemStats, decodeRegion, decodeSector, decodeStat, decodeStats, Shipload as default, deriveLocation, deriveLocationSize, deriveLocationStatic, deriveResourceStats, deriveStatMappings, deriveStrata, deriveStratum, derivedLoaders, describeItem, describeModule, describeModuleForItem, describeModuleForSlot, deserializeAsset, deserializeAtomicData, deserializeComponent, deserializeEntity, deserializeModule, deserializeResource, displayName, distanceBetweenCoordinates, distanceBetweenPoints, easeFlightProgress, eligibleUpgrades, encodeAddress, encodeAddressMemo, encodeGatheredCargoStats, encodeRegion, encodeSector, encodeStats, energyAtTime, energyPercent, energy_stats, entityDisplayName, entity_row, estimateDealTravelTime, estimateTravelTime, estimateUnwrapDuration, feistel, feistelInv, fetchAtomicAssetsForOwner, fetchAtomicSchemas, filterByBuildMethod, findNearbyPlanets, flightSpeedFactor, formatLocation, formatMass, formatMassDelta, formatMassScaled, formatModuleLine, formatTier, gatherEnergyCost, gathererDepthForTier, getAllRecipes, getBaseHullmassFor, getCapabilityAttributeRows, getCapabilityAttributes, getCategoryInfo, getComponentDemand, getComponents, getCurrentEpoch, getDepthThreshold, getDestinationLocation, getEffectiveReserve, getEligibleResources, getEntityClass, getEntityItems, getEntityLayout, getEpochInfo, getFlightOrigin, getInterpolatedPosition, getItem, getItems, getKindMeta, getLocationCandidates, getLocationKind, getLocationProfile, getLocationType, getLocationTypeName, getModuleCapabilityType, getModules, getPackedEntityType, getPlanetSubtype, getPlanetSubtypes, getPositionAt, getProducersForAttribute, getRecipe, getRecipeConsumers, getResourceDemand, getResourceTier, getResourceWeight, getResources, getStatDefinitions, getStatMappings, getStatMappingsForCapability, getStatMappingsForStat, getStatName, getSystemName, getTemplateMeta, hasEnergy, hasEnergyForDistance, hasGatherer, hasLoaders, hasMass, hasSchedule, hasSpace$1 as hasSpace, hasSpaceForMass, hasStorage, hasSystem, hash, hash512, incomingHoldMass, interpolateFlightPosition, isBuildable, isConstructionDock, isContainer, isCraftedItem, isExtractor, isFactory, isFull$1 as isFull, isFullFromMass, isGatherableLocation, isHub, isInvertedAttribute, isLocationBuildable, isModuleItem, isNexus, isPlot, isPlotBuildable, isRelatedItem, isShip, isSubscriptionsDebugEnabled, isValidWormholePair, isWarehouse, isWorkshop, itemAbbreviations, itemCategory, itemIds, itemOffset, itemTier, itemTypeCode, jobsToLanes, kindCan, lane, laneKeyForModule, lerp, location_derived, location_static, makeEntity, mapEntity, maxCraftable, maxQtyForCharge, maxTravelDistance, mergeStacks, moduleAccepts, moduleDisplayName, moduleIcon, moduleSlotTypeToCode, movement_stats, nearbyWormholes, needsRecharge, normalizeDisplayName, parseWireEntity, partnerRegion, pickFabricator, planParallelTransfer, planRoute, projectEntity, projectEntityAt, projectRemainingAt, projectedCargoAvailableAt, projectedPeakCargomass, rawScheduleEnd, readCommonBase, receiveFits, regionOf, removeFromStacks, renderDescription, resolveItem, resolveItemCategory, resolveLaneBuilder, resolveLaneCrafter, resolveLaneGatherer, resolveLaneLoader, resolveLockedAmount, resolveStats, rollTier, rollWithinTier, rollupBuilder, rollupCrafter, rollupGatherer, rollupLoaders, rotation, schedule, sdkSystemGraph, selectGatherLane, setSubscriptionsDebug, simulateRoute, slotAcceptsModule, socketTail, sourceLabelForOutput, splitCost, stackKey, stackToCargoItem, stacksEqual, starRating, starsForStat, statMagnitude, subtractFromStacks, task, taskCargoChanges, taskCargoEffect, tierAdjective, tierColors, tierOfReserve, toLocation, typeLabel, unwrapLoadDuration, unwrapTransitDuration, usedInputStatKeys, validateDisplayName, validateSchedule, workerLaneKey, wormholeAt, wormholeAtRegionEndpoint, yieldThresholdAt };
package/lib/shipload.js CHANGED
@@ -12632,6 +12632,24 @@ function keyForRecipeInputStat(recipe, inputIndex, statIndex) {
12632
12632
  const innerKeys = getItemStatKeys(input.itemId);
12633
12633
  return innerKeys[statIndex] ?? '';
12634
12634
  }
12635
+ function usedInputStatKeys(outputItemId) {
12636
+ const recipe = getRecipe(outputItemId);
12637
+ if (!recipe)
12638
+ return [];
12639
+ const usedIdx = recipe.inputs.map(() => new Set());
12640
+ for (const slot of recipe.statSlots) {
12641
+ for (const src of slot.sources) {
12642
+ usedIdx[src.inputIndex]?.add(src.statIndex);
12643
+ }
12644
+ }
12645
+ return recipe.inputs.map((input, i) => {
12646
+ const keys = getItemStatKeys(input.itemId);
12647
+ return [...usedIdx[i]]
12648
+ .sort((a, b) => a - b)
12649
+ .map((idx) => keys[idx] ?? '')
12650
+ .filter(Boolean);
12651
+ });
12652
+ }
12635
12653
  function decodeCraftedItemStats(itemId, stats) {
12636
12654
  const keys = getItemStatKeys(itemId);
12637
12655
  const result = {};
@@ -17353,23 +17371,28 @@ class ConstructionManager extends BaseManager {
17353
17371
  }
17354
17372
  inboundTransfersByTarget(entities, now) {
17355
17373
  const buckets = new Map();
17374
+ const entitiesById = new Map(entities.map((entity) => [entity.id.toString(), entity]));
17356
17375
  const nowMs = now.getTime();
17357
17376
  for (const entity of entities) {
17358
- const entityIdStr = entity.id.toString();
17359
- const sourceName = entity.entity_name || entityIdStr;
17360
17377
  for (const lane of getLanes(entity)) {
17361
17378
  const startedMs = lane.schedule.started.toDate().getTime();
17362
17379
  let cumulativeSec = 0;
17363
17380
  for (const task of lane.schedule.tasks) {
17364
17381
  cumulativeSec += task.duration.toNumber();
17365
- if (!isPushTask(task))
17382
+ if (!isDeliveryTask(task))
17366
17383
  continue;
17367
- if (task.couplings.length === 0)
17384
+ const target = deliveryTarget(task);
17385
+ if (!target)
17386
+ continue;
17387
+ const source = deliverySource(task, entity, entitiesById);
17388
+ if (!source)
17368
17389
  continue;
17369
17390
  const projectedEndMs = startedMs + cumulativeSec * 1000;
17370
17391
  if (projectedEndMs < nowMs)
17371
17392
  continue;
17372
- const targetIdStr = task.couplings[0].counterpart.entity_id.toString();
17393
+ const targetIdStr = target.entity_id.toString();
17394
+ const sourceIdStr = source.id.toString();
17395
+ const sourceName = source.entity_name || sourceIdStr;
17373
17396
  const etaSeconds = Math.max(0, Math.round((projectedEndMs - nowMs) / 1000));
17374
17397
  let perTarget = buckets.get(targetIdStr);
17375
17398
  if (!perTarget) {
@@ -17381,7 +17404,7 @@ class ConstructionManager extends BaseManager {
17381
17404
  const quantity = c.quantity.toNumber();
17382
17405
  if (quantity === 0)
17383
17406
  continue;
17384
- const key = `${entityIdStr}#${itemId}`;
17407
+ const key = `${sourceIdStr}#${itemId}`;
17385
17408
  const existing = perTarget.get(key);
17386
17409
  if (existing) {
17387
17410
  existing.quantity += quantity;
@@ -17389,8 +17412,8 @@ class ConstructionManager extends BaseManager {
17389
17412
  }
17390
17413
  else {
17391
17414
  perTarget.set(key, {
17392
- sourceEntityId: entity.id,
17393
- sourceEntityType: entity.type,
17415
+ sourceEntityId: source.id,
17416
+ sourceEntityType: source.type,
17394
17417
  sourceName,
17395
17418
  itemId,
17396
17419
  quantity,
@@ -17583,7 +17606,24 @@ function partitionSources(target, entities, cargo) {
17583
17606
  }
17584
17607
  return { eligible, unreachable };
17585
17608
  }
17586
- function isPushTask(task) {
17609
+ function isDeliveryTask(task) {
17610
+ const type = task.type.toNumber();
17611
+ return type === exports.TaskType.UNLOAD || type === exports.TaskType.SHUTTLE;
17612
+ }
17613
+ function deliveryTarget(task) {
17614
+ if (task.type.toNumber() === exports.TaskType.SHUTTLE) {
17615
+ return task.couplings.find((coupling) => coupling.kind.toNumber() === exports.HoldKind.PUSH)
17616
+ ?.counterpart;
17617
+ }
17618
+ return task.couplings[0]?.counterpart;
17619
+ }
17620
+ function deliverySource(task, transporter, entitiesById) {
17621
+ if (task.type.toNumber() !== exports.TaskType.SHUTTLE)
17622
+ return transporter;
17623
+ const source = task.couplings.find((coupling) => coupling.kind.toNumber() === exports.HoldKind.PULL)?.counterpart;
17624
+ return source ? entitiesById.get(source.entity_id.toString()) : undefined;
17625
+ }
17626
+ function isReservingPushTask(task) {
17587
17627
  return task.type.toNumber() === exports.TaskType.UNLOAD;
17588
17628
  }
17589
17629
  function isBuildOfPlot(task, plotId) {
@@ -17594,7 +17634,7 @@ function isBuildOfPlot(task, plotId) {
17594
17634
  function reservationsOf(source) {
17595
17635
  const out = new Map();
17596
17636
  for (const task of getTasks(source)) {
17597
- if (!isPushTask(task))
17637
+ if (!isReservingPushTask(task))
17598
17638
  continue;
17599
17639
  if (task.couplings.length === 0)
17600
17640
  continue;
@@ -18856,6 +18896,18 @@ function composeIdleResolve(blocker, action, actions, now, lookupCounterpart) {
18856
18896
  return [...ids.map((id) => actions.resolve(id)), action];
18857
18897
  }
18858
18898
 
18899
+ const INCOMING_COUPLING_KINDS = new Set([exports.HoldKind.PUSH, exports.HoldKind.GATHER, exports.HoldKind.FLIGHT]);
18900
+ function isIncomingCouplingKind(kind) {
18901
+ return INCOMING_COUPLING_KINDS.has(kind);
18902
+ }
18903
+ function calcCounterpartDelivery(task, coupling) {
18904
+ if (!isIncomingCouplingKind(coupling.kind.toNumber()))
18905
+ return [];
18906
+ if (task.type.toNumber() === exports.TaskType.CRAFT) {
18907
+ return task.cargo.length === 0 ? [] : [task.cargo[task.cargo.length - 1]];
18908
+ }
18909
+ return task.cargo;
18910
+ }
18859
18911
  function taskCargoEffect(task) {
18860
18912
  switch (task.type.toNumber()) {
18861
18913
  case exports.TaskType.LOAD:
@@ -18863,6 +18915,7 @@ function taskCargoEffect(task) {
18863
18915
  case exports.TaskType.UNDEPLOY:
18864
18916
  return { added: task.cargo, removed: [] };
18865
18917
  case exports.TaskType.UNLOAD:
18918
+ case exports.TaskType.UPGRADE:
18866
18919
  return { added: [], removed: task.cargo };
18867
18920
  case exports.TaskType.GATHER:
18868
18921
  return task.couplings.length > 0
@@ -18879,19 +18932,23 @@ function taskCargoEffect(task) {
18879
18932
  return { added: [], removed: [] };
18880
18933
  }
18881
18934
  }
18882
- function cargoKey(item) {
18883
- const base = `${item.item_id.toNumber()}:${item.stats.toString()}`;
18884
- const modules = item.modules ?? [];
18885
- const entityId = item.entity_id?.toString();
18886
- const normalizedEntityId = entityId && entityId !== '0' ? entityId : '';
18935
+ function refKey(itemId, stats, modules, entityId) {
18936
+ const base = `${itemId}:${stats.toString()}`;
18937
+ const normalizedEntityId = entityId !== '0' ? entityId : '';
18887
18938
  if (modules.length === 0 && normalizedEntityId === '')
18888
18939
  return base;
18889
18940
  return `${base}:modules=${JSON.stringify(modules)}:entity=${normalizedEntityId}`;
18890
18941
  }
18942
+ function cargoKey(item) {
18943
+ return refKey(item.item_id.toNumber(), BigInt(item.stats.toString()), item.modules ?? [], item.entity_id?.toString() ?? '');
18944
+ }
18945
+ function cargoInputKey(input) {
18946
+ return refKey(input.itemId, input.stats, input.modules ?? [], '');
18947
+ }
18891
18948
  function cargoQuantity(item) {
18892
18949
  return BigInt(item.quantity.toString());
18893
18950
  }
18894
- function projectedCargoAvailableAt(entity, at) {
18951
+ function projectedCargoAvailableAt(entity, at, incoming = []) {
18895
18952
  const avail = new Map();
18896
18953
  for (const item of entity.cargo) {
18897
18954
  const key = cargoKey(item);
@@ -18906,6 +18963,14 @@ function projectedCargoAvailableAt(entity, at) {
18906
18963
  avail.set(key, (avail.get(key) ?? 0n) + cargoQuantity(item));
18907
18964
  }
18908
18965
  }
18966
+ for (const src of incoming) {
18967
+ if (src.until.getTime() >= at.getTime())
18968
+ continue;
18969
+ for (const item of src.items) {
18970
+ const key = cargoKey(item);
18971
+ avail.set(key, (avail.get(key) ?? 0n) + cargoQuantity(item));
18972
+ }
18973
+ }
18909
18974
  for (const ordered of tasks) {
18910
18975
  for (const item of taskCargoEffect(ordered.task).removed) {
18911
18976
  const key = cargoKey(item);
@@ -18916,17 +18981,40 @@ function projectedCargoAvailableAt(entity, at) {
18916
18981
  }
18917
18982
  return avail;
18918
18983
  }
18919
- function cargoReadyAt(entity, inputItemIds) {
18920
- let readyMs = 0;
18984
+ function cargoReadyAt(entity, inputs, incoming = []) {
18985
+ const demand = new Map();
18986
+ for (const input of inputs) {
18987
+ const key = cargoInputKey(input);
18988
+ demand.set(key, (demand.get(key) ?? 0n) + BigInt(input.quantity));
18989
+ }
18990
+ const candidates = [0];
18921
18991
  for (const ordered of orderedTasks(entity)) {
18922
18992
  for (const item of taskCargoEffect(ordered.task).added) {
18923
- if (inputItemIds.includes(item.item_id.toNumber())) {
18924
- readyMs = Math.max(readyMs, ordered.completesAt.getTime());
18993
+ if (demand.has(cargoKey(item))) {
18994
+ candidates.push(ordered.completesAt.getTime());
18925
18995
  break;
18926
18996
  }
18927
18997
  }
18928
18998
  }
18929
- return new Date(readyMs);
18999
+ for (const src of incoming) {
19000
+ if (src.items.some((item) => demand.has(cargoKey(item)))) {
19001
+ candidates.push(src.until.getTime());
19002
+ }
19003
+ }
19004
+ candidates.sort((a, b) => a - b);
19005
+ for (const candidateMs of candidates) {
19006
+ const available = projectedCargoAvailableAt(entity, new Date(candidateMs + 1), incoming);
19007
+ let sufficient = true;
19008
+ for (const [key, quantity] of demand) {
19009
+ if ((available.get(key) ?? 0n) < quantity) {
19010
+ sufficient = false;
19011
+ break;
19012
+ }
19013
+ }
19014
+ if (sufficient)
19015
+ return new Date(candidateMs);
19016
+ }
19017
+ return new Date(candidates[candidates.length - 1]);
18930
19018
  }
18931
19019
  function availableForItem(avail, itemId) {
18932
19020
  const prefix = `${itemId}:`;
@@ -18945,6 +19033,7 @@ exports.CancelBlockReason = void 0;
18945
19033
  CancelBlockReason["DONE"] = "DONE";
18946
19034
  CancelBlockReason["CONTAINS_LINKED_TASK"] = "CONTAINS_LINKED_TASK";
18947
19035
  CancelBlockReason["WOULD_STRAND"] = "WOULD_STRAND";
19036
+ CancelBlockReason["WOULD_STRAND_COUNTERPART"] = "WOULD_STRAND_COUNTERPART";
18948
19037
  CancelBlockReason["WOULD_OVERFILL"] = "WOULD_OVERFILL";
18949
19038
  CancelBlockReason["NOT_OWNER"] = "NOT_OWNER";
18950
19039
  })(exports.CancelBlockReason || (exports.CancelBlockReason = {}));
@@ -18955,14 +19044,16 @@ function postCancelEntity(entity, laneKey, fromTaskIndex) {
18955
19044
  lane.schedule.tasks = lane.schedule.tasks.slice(0, fromTaskIndex);
18956
19045
  return clone;
18957
19046
  }
18958
- function feasibleAfterCancel(post) {
18959
- const ordered = orderedTasks(post);
19047
+ function queueFeasible(entity, incoming = []) {
19048
+ const ordered = orderedTasks(entity);
18960
19049
  const base = new Map();
18961
- for (const c of post.cargo ?? []) {
19050
+ for (const c of entity.cargo ?? []) {
18962
19051
  const k = cargoKey(c);
18963
19052
  base.set(k, (base.get(k) ?? 0) + c.quantity.toNumber());
18964
19053
  }
18965
- const isConsumer = (t) => t.type.toNumber() === exports.TaskType.CRAFT || t.type.toNumber() === exports.TaskType.UNLOAD;
19054
+ const isConsumer = (t) => t.type.toNumber() === exports.TaskType.CRAFT ||
19055
+ t.type.toNumber() === exports.TaskType.UNLOAD ||
19056
+ t.type.toNumber() === exports.TaskType.UPGRADE;
18966
19057
  for (const self of ordered) {
18967
19058
  if (!isConsumer(self.task))
18968
19059
  continue;
@@ -18974,6 +19065,13 @@ function feasibleAfterCancel(post) {
18974
19065
  map.set(cargoKey(out), (map.get(cargoKey(out)) ?? 0) + out.quantity.toNumber());
18975
19066
  }
18976
19067
  }
19068
+ for (const src of incoming) {
19069
+ if (src.until.getTime() >= self.completesAt.getTime())
19070
+ continue;
19071
+ for (const item of src.items) {
19072
+ map.set(cargoKey(item), (map.get(cargoKey(item)) ?? 0) + item.quantity.toNumber());
19073
+ }
19074
+ }
18977
19075
  for (const other of ordered) {
18978
19076
  if (other === self)
18979
19077
  continue;
@@ -18987,6 +19085,11 @@ function feasibleAfterCancel(post) {
18987
19085
  return false;
18988
19086
  }
18989
19087
  }
19088
+ return true;
19089
+ }
19090
+ function feasibleAfterCancel(post) {
19091
+ if (!queueFeasible(post))
19092
+ return false;
18990
19093
  try {
18991
19094
  validateSchedule(post);
18992
19095
  }
@@ -19044,6 +19147,35 @@ function cancelEligibility(entity, laneKey, fromTaskIndex, input) {
19044
19147
  const post = postCancelEntity(entity, laneKey, fromTaskIndex);
19045
19148
  if (!feasibleAfterCancel(post))
19046
19149
  return block(exports.CancelBlockReason.WOULD_STRAND);
19150
+ const releasedByCounterpart = new Map();
19151
+ for (const i of taskIndices) {
19152
+ for (const c of tasks[i].couplings ?? []) {
19153
+ if (!isIncomingCouplingKind(c.kind.toNumber()))
19154
+ continue;
19155
+ const id = c.counterpart.entity_id.toString();
19156
+ const entry = releasedByCounterpart.get(id) ?? {
19157
+ counterpart: c.counterpart,
19158
+ holdIds: new Set(),
19159
+ };
19160
+ entry.holdIds.add(c.hold.toString());
19161
+ releasedByCounterpart.set(id, entry);
19162
+ }
19163
+ }
19164
+ for (const [counterpartId, released] of releasedByCounterpart) {
19165
+ const counterpart = input.counterparts?.get(counterpartId);
19166
+ if (!counterpart)
19167
+ continue;
19168
+ const incoming = (input.counterpartIncoming?.get(counterpartId) ?? []).filter((src) => !released.holdIds.has(src.holdId));
19169
+ if (!queueFeasible(counterpart, incoming)) {
19170
+ return {
19171
+ ok: false,
19172
+ blockedReason: exports.CancelBlockReason.WOULD_STRAND_COUNTERPART,
19173
+ blockedByCounterpart: released.counterpart,
19174
+ range,
19175
+ effects: { ...EMPTY_EFFECTS },
19176
+ };
19177
+ }
19178
+ }
19047
19179
  const effects = { refunds: [], releasedHolds: [], abandonsRunning: false };
19048
19180
  let energyForfeited = 0;
19049
19181
  for (const i of taskIndices) {
@@ -19193,7 +19325,24 @@ function receiveFits(dest, item, now) {
19193
19325
  return peak <= capacity;
19194
19326
  }
19195
19327
 
19196
- function maxCraftable(entity, recipe, crafterSpeed, now) {
19328
+ function itemReadyAt(entity, itemIds, incoming) {
19329
+ let readyMs = 0;
19330
+ for (const ordered of orderedTasks(entity)) {
19331
+ for (const item of taskCargoEffect(ordered.task).added) {
19332
+ if (itemIds.includes(item.item_id.toNumber())) {
19333
+ readyMs = Math.max(readyMs, ordered.completesAt.getTime());
19334
+ break;
19335
+ }
19336
+ }
19337
+ }
19338
+ for (const src of incoming) {
19339
+ if (src.items.some((item) => itemIds.includes(item.item_id.toNumber()))) {
19340
+ readyMs = Math.max(readyMs, src.until.getTime());
19341
+ }
19342
+ }
19343
+ return new Date(readyMs);
19344
+ }
19345
+ function maxCraftable(entity, recipe, crafterSpeed, now, incoming = []) {
19197
19346
  if (recipe.inputs.length === 0)
19198
19347
  return 0;
19199
19348
  const perUnitMass = recipe.inputs.reduce((sum, input) => sum + getItem(input.itemId).mass * input.quantity, 0);
@@ -19201,9 +19350,9 @@ function maxCraftable(entity, recipe, crafterSpeed, now) {
19201
19350
  const crafterLane = workerLaneKey(entity.modules, 'crafter', entity.lanes ?? []);
19202
19351
  const naiveCompletesAt = candidateLaneCompletesAt(entity, crafterLane, perUnitDuration, now);
19203
19352
  const laneStartMs = naiveCompletesAt.getTime() - perUnitDuration * 1000;
19204
- const readyMs = cargoReadyAt(entity, recipe.inputs.map((input) => input.itemId)).getTime();
19353
+ const readyMs = itemReadyAt(entity, recipe.inputs.map((input) => input.itemId), incoming).getTime();
19205
19354
  const completesAt = new Date(Math.max(laneStartMs, readyMs) + perUnitDuration * 1000);
19206
- const availability = projectedCargoAvailableAt(entity, completesAt);
19355
+ const availability = projectedCargoAvailableAt(entity, completesAt, incoming);
19207
19356
  let maxUnits;
19208
19357
  for (const input of recipe.inputs) {
19209
19358
  if (input.quantity <= 0)
@@ -21254,6 +21403,7 @@ exports.buildModuleImmutable = buildModuleImmutable;
21254
21403
  exports.buildResourceImmutable = buildResourceImmutable;
21255
21404
  exports.calcCargoItemMass = calcCargoItemMass;
21256
21405
  exports.calcCargoMass = calcCargoMass;
21406
+ exports.calcCounterpartDelivery = calcCounterpartDelivery;
21257
21407
  exports.calcEnergyUsage = calcEnergyUsage;
21258
21408
  exports.calcStacksMass = calcStacksMass;
21259
21409
  exports.calc_acceleration = calc_acceleration;
@@ -21297,8 +21447,10 @@ exports.capsHasLoaders = capsHasLoaders;
21297
21447
  exports.capsHasMass = capsHasMass;
21298
21448
  exports.capsHasMovement = capsHasMovement;
21299
21449
  exports.capsHasStorage = capsHasStorage;
21450
+ exports.cargoInputKey = cargoInputKey;
21300
21451
  exports.cargoItem = cargoItem;
21301
21452
  exports.cargoItemToStack = cargoItemToStack;
21453
+ exports.cargoKey = cargoKey;
21302
21454
  exports.cargoReadyAt = cargoReadyAt;
21303
21455
  exports.cargoRef = cargoRef;
21304
21456
  exports.cargoUtils = cargoUtils;
@@ -21579,6 +21731,7 @@ exports.toLocation = toLocation;
21579
21731
  exports.typeLabel = typeLabel;
21580
21732
  exports.unwrapLoadDuration = unwrapLoadDuration;
21581
21733
  exports.unwrapTransitDuration = unwrapTransitDuration;
21734
+ exports.usedInputStatKeys = usedInputStatKeys;
21582
21735
  exports.validateDisplayName = validateDisplayName;
21583
21736
  exports.validateSchedule = validateSchedule;
21584
21737
  exports.workerLaneKey = workerLaneKey;