@casual-simulation/aux-runtime 3.3.14 → 3.4.0-alpha.13932534773

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 (35) hide show
  1. package/package.json +7 -7
  2. package/runtime/AuxCompiler.d.ts +3 -3
  3. package/runtime/AuxCompiler.js.map +1 -1
  4. package/runtime/AuxDevice.d.ts +5 -0
  5. package/runtime/AuxGlobalContext.d.ts +10 -8
  6. package/runtime/AuxGlobalContext.js +2 -2
  7. package/runtime/AuxGlobalContext.js.map +1 -1
  8. package/runtime/AuxLibrary.d.ts +11 -11
  9. package/runtime/AuxLibrary.js +13 -5
  10. package/runtime/AuxLibrary.js.map +1 -1
  11. package/runtime/AuxPartitionRealtimeEditModeProvider.d.ts +2 -2
  12. package/runtime/AuxPartitionRealtimeEditModeProvider.js +1 -1
  13. package/runtime/AuxPartitionRealtimeEditModeProvider.js.map +1 -1
  14. package/runtime/AuxResults.d.ts +2 -2
  15. package/runtime/AuxRuntime.d.ts +15 -21
  16. package/runtime/AuxRuntime.js +7 -56
  17. package/runtime/AuxRuntime.js.map +1 -1
  18. package/runtime/CompiledBot.d.ts +3 -3
  19. package/runtime/CompiledBot.js.map +1 -1
  20. package/runtime/RecordsEvents.d.ts +1 -1
  21. package/runtime/RecordsEvents.js +0 -1
  22. package/runtime/RecordsEvents.js.map +1 -1
  23. package/runtime/RuntimeBot.d.ts +4 -4
  24. package/runtime/RuntimeBot.js +1 -0
  25. package/runtime/RuntimeBot.js.map +1 -1
  26. package/runtime/RuntimeEvents.d.ts +3 -3
  27. package/runtime/RuntimeStateVersion.d.ts +1 -1
  28. package/runtime/RuntimeStateVersion.js.map +1 -1
  29. package/runtime/Transpiler.d.ts +3 -2
  30. package/runtime/Transpiler.js +1 -1
  31. package/runtime/Transpiler.js.map +1 -1
  32. package/runtime/Utils.d.ts +1 -1
  33. package/runtime/test/TestScriptBotFactory.d.ts +3 -2
  34. package/runtime/test/TestScriptBotFactory.js +1 -1
  35. package/runtime/test/TestScriptBotFactory.js.map +1 -1
@@ -1,5 +1,5 @@
1
- import { AuxRealtimeEditModeProvider } from './AuxRealtimeEditModeProvider';
2
- import { AuxPartitions } from '@casual-simulation/aux-common';
1
+ import type { AuxRealtimeEditModeProvider } from './AuxRealtimeEditModeProvider';
2
+ import type { AuxPartitions } from '@casual-simulation/aux-common';
3
3
  import { RealtimeEditMode } from './RuntimeBot';
4
4
  export declare class AuxPartitionRealtimeEditModeProvider implements AuxRealtimeEditModeProvider {
5
5
  private _partitions;
@@ -1,4 +1,4 @@
1
- import { DEFAULT_REALTIME_EDIT_MODE, } from './AuxRealtimeEditModeProvider';
1
+ import { DEFAULT_REALTIME_EDIT_MODE } from './AuxRealtimeEditModeProvider';
2
2
  import { realtimeStrategyToRealtimeEditMode } from './Utils';
3
3
  import { RealtimeEditMode } from './RuntimeBot';
4
4
  export class AuxPartitionRealtimeEditModeProvider {
@@ -1 +1 @@
1
- {"version":3,"file":"AuxPartitionRealtimeEditModeProvider.js","sourceRoot":"","sources":["AuxPartitionRealtimeEditModeProvider.ts"],"names":[],"mappings":"AAAA,OAAO,EAEH,0BAA0B,GAC7B,MAAM,+BAA+B,CAAC;AAEvC,OAAO,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,OAAO,oCAAoC;IAK7C,YAAY,UAAyB;QACjC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC5B,OAAO,kCAAkC,CACrC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAC3C,CAAC;QACN,CAAC;QACD,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YACxB,OAAO,gBAAgB,CAAC,IAAI,CAAC;QACjC,CAAC;aAAM,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/B,OAAO,gBAAgB,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,OAAO,0BAA0B,CAAC;IACtC,CAAC;CACJ"}
1
+ {"version":3,"file":"AuxPartitionRealtimeEditModeProvider.js","sourceRoot":"","sources":["AuxPartitionRealtimeEditModeProvider.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAE3E,OAAO,EAAE,kCAAkC,EAAE,MAAM,SAAS,CAAC;AAC7D,OAAO,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAEhD,MAAM,OAAO,oCAAoC;IAK7C,YAAY,UAAyB;QACjC,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;IAClC,CAAC;IAED,WAAW,CAAC,KAAa;QACrB,IAAI,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YAC5B,OAAO,kCAAkC,CACrC,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAC3C,CAAC;QACN,CAAC;QACD,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YACxB,OAAO,gBAAgB,CAAC,IAAI,CAAC;QACjC,CAAC;aAAM,IAAI,KAAK,KAAK,WAAW,EAAE,CAAC;YAC/B,OAAO,gBAAgB,CAAC,IAAI,CAAC;QACjC,CAAC;QACD,OAAO,0BAA0B,CAAC;IACtC,CAAC;CACJ"}
@@ -1,5 +1,5 @@
1
- import { Bot } from '@casual-simulation/aux-common/bots/Bot';
2
- import { RuntimeActions } from './RuntimeEvents';
1
+ import type { Bot } from '@casual-simulation/aux-common/bots/Bot';
2
+ import type { RuntimeActions } from './RuntimeEvents';
3
3
  export declare class RanOutOfEnergyError extends Error {
4
4
  constructor();
5
5
  }
@@ -1,18 +1,19 @@
1
- import { StateUpdatedEvent, Bot, BotSpace, RuntimeBot, CompiledBotListener, BotModuleResult, ResolvedBotModule, ImportMetadata } from '@casual-simulation/aux-common/bots';
2
- import { Observable, SubscriptionLike } from 'rxjs';
3
- import { AuxGlobalContext } from './AuxGlobalContext';
4
- import { AuxLibrary } from './AuxLibrary';
5
- import { RuntimeBotInterface, RuntimeBotFactory, RealtimeEditMode, RealtimeEditConfig, RuntimeInterpreterGeneratorProcessor } from './RuntimeBot';
6
- import { CompiledBot, CompiledBotsState, RuntimeBreakpoint, RuntimeStop } from './CompiledBot';
7
- import { ScriptError, ActionResult } from './AuxResults';
8
- import { AuxVersion } from './AuxVersion';
9
- import { AuxDevice } from './AuxDevice';
10
- import { RuntimePromise } from './Utils';
11
- import { AuxRealtimeEditModeProvider } from './AuxRealtimeEditModeProvider';
12
- import { CurrentVersion } from '@casual-simulation/aux-common';
13
- import { RuntimeStateVersion } from './RuntimeStateVersion';
1
+ import type { StateUpdatedEvent, Bot, BotSpace, RuntimeBot, CompiledBotListener, BotModuleResult, ResolvedBotModule, ImportMetadata } from '@casual-simulation/aux-common/bots';
2
+ import type { Observable, SubscriptionLike } from 'rxjs';
3
+ import type { AuxGlobalContext } from './AuxGlobalContext';
4
+ import type { AuxLibrary } from './AuxLibrary';
5
+ import type { RuntimeBotInterface, RuntimeBotFactory, RealtimeEditConfig, RuntimeInterpreterGeneratorProcessor } from './RuntimeBot';
6
+ import { RealtimeEditMode } from './RuntimeBot';
7
+ import type { CompiledBot, CompiledBotsState, RuntimeBreakpoint, RuntimeStop } from './CompiledBot';
8
+ import type { ScriptError, ActionResult } from './AuxResults';
9
+ import type { AuxVersion } from './AuxVersion';
10
+ import type { AuxDevice } from './AuxDevice';
11
+ import type { RuntimePromise } from './Utils';
12
+ import type { AuxRealtimeEditModeProvider } from './AuxRealtimeEditModeProvider';
13
+ import type { CurrentVersion } from '@casual-simulation/aux-common';
14
+ import type { RuntimeStateVersion } from './RuntimeStateVersion';
14
15
  import type { Interpreter as InterpreterType, InterpreterContinuation, InterpreterStop } from '@casual-simulation/js-interpreter';
15
- import { RuntimeActions } from './RuntimeEvents';
16
+ import type { RuntimeActions } from './RuntimeEvents';
16
17
  export declare function registerInterpreterModule(module: any): void;
17
18
  /**
18
19
  * Defines an class that is able to manage the runtime state of an AUX.
@@ -267,12 +268,5 @@ export declare class AuxRuntime implements RuntimeBotInterface, RuntimeBotFactor
267
268
  private _executeGenerator;
268
269
  }
269
270
  type MaybeRuntimePromise<T> = T | RuntimePromise<T>;
270
- /**
271
- * Recursively maps each of the given library's functions using the given map function and returns a new library that contains the converted functions.
272
- * The returned object will contain the same enumerable properties as the original library except that its functions have been mapped.
273
- * @param library The library to map.
274
- * @param map The function to use for mapping library functions.
275
- */
276
- export declare function mapLibraryFunctions<T extends AuxLibrary>(library: T, map: (func: Function, key: string) => any): T;
277
271
  export {};
278
272
  //# sourceMappingURL=AuxRuntime.d.ts.map
@@ -18,14 +18,14 @@ import { hasValue, tagsOnBot, isFormula, isScript, isNumber, BOT_SPACE_TAG, botU
18
18
  import { Subject, Subscription } from 'rxjs';
19
19
  import { AuxCompiler, getInterpretableFunction, isInterpretableFunction, IMPORT_META_FACTORY, IMPORT_FACTORY, EXPORT_FACTORY, } from './AuxCompiler';
20
20
  import { addToContext, MemoryGlobalContext, removeFromContext, isInContext, } from './AuxGlobalContext';
21
- import { createDefaultLibrary, GET_RUNTIME, } from './AuxLibrary';
22
- import { createRuntimeBot, RealtimeEditMode, } from './RuntimeBot';
23
- import { RanOutOfEnergyError, } from './AuxResults';
21
+ import { createDefaultLibrary, GET_RUNTIME } from './AuxLibrary';
22
+ import { createRuntimeBot, RealtimeEditMode } from './RuntimeBot';
23
+ import { RanOutOfEnergyError } from './AuxResults';
24
24
  import { isPromise, isRuntimePromise, isUrl, markAsRuntimePromise, } from './Utils';
25
- import { DefaultRealtimeEditModeProvider, } from './AuxRealtimeEditModeProvider';
25
+ import { DefaultRealtimeEditModeProvider } from './AuxRealtimeEditModeProvider';
26
26
  import { sortBy, forOwn, merge, union } from 'lodash';
27
27
  import { applyTagEdit, isTagEdit, } from '@casual-simulation/aux-common/bots';
28
- import { updateRuntimeVersion, } from './RuntimeStateVersion';
28
+ import { updateRuntimeVersion } from './RuntimeStateVersion';
29
29
  import { replaceMacros } from './Transpiler';
30
30
  import { DateTime } from 'luxon';
31
31
  import { Rotation, Vector2, Vector3 } from '@casual-simulation/aux-common/math';
@@ -397,7 +397,7 @@ export class AuxRuntime {
397
397
  config: null,
398
398
  };
399
399
  for (let key in this._library.tagSpecificApi) {
400
- if (!this._library.tagSpecificApi.hasOwnProperty(key)) {
400
+ if (!Object.prototype.hasOwnProperty.call(this._library.tagSpecificApi, key)) {
401
401
  continue;
402
402
  }
403
403
  const result = this._library.tagSpecificApi[key](ctx);
@@ -473,6 +473,7 @@ export class AuxRuntime {
473
473
  split.pop();
474
474
  }
475
475
  else if (moduleName[i] === '.') {
476
+ /* empty */
476
477
  }
477
478
  else {
478
479
  moduleName =
@@ -3026,56 +3027,6 @@ export class AuxRuntime {
3026
3027
  }
3027
3028
  }
3028
3029
  }
3029
- /**
3030
- * Recursively maps each of the given library's functions using the given map function and returns a new library that contains the converted functions.
3031
- * The returned object will contain the same enumerable properties as the original library except that its functions have been mapped.
3032
- * @param library The library to map.
3033
- * @param map The function to use for mapping library functions.
3034
- */
3035
- export function mapLibraryFunctions(library, map) {
3036
- let newLibrary = Object.assign({}, library);
3037
- newLibrary.api = mapFunctions(newLibrary.api, map);
3038
- return newLibrary;
3039
- }
3040
- function mapFunctions(obj, map) {
3041
- let newObj = Object.create(obj);
3042
- assignFunctions(obj, newObj, map);
3043
- return newObj;
3044
- }
3045
- function assignFunctions(obj, newObj, map) {
3046
- let descriptors = Object.getOwnPropertyDescriptors(obj);
3047
- for (let key in descriptors) {
3048
- let descriptor = descriptors[key];
3049
- if (descriptor.get || descriptor.set || !descriptor.enumerable) {
3050
- continue;
3051
- }
3052
- const val = descriptor.value;
3053
- if (typeof val === 'function') {
3054
- let newFunc = (newObj[key] = map(val, key));
3055
- if (newFunc) {
3056
- assignFunctions(val, newFunc, map);
3057
- }
3058
- continue;
3059
- }
3060
- if (typeof val !== 'object' ||
3061
- val === null ||
3062
- Object.getPrototypeOf(val).constructor !== Object) {
3063
- continue;
3064
- }
3065
- newObj[key] = mapFunctions(val, map);
3066
- }
3067
- }
3068
- // function wrapGeneratorFunc<T>(
3069
- // func: (...args: any[]) => T
3070
- // ): (...args: any[]) => T {
3071
- // return (...args: any[]) => {
3072
- // let res = func(...args);
3073
- // if (isGenerator(res)) {
3074
- // return unwind(res);
3075
- // }
3076
- // return res;
3077
- // };
3078
- // }
3079
3030
  /**
3080
3031
  * Processes the given list of items in a sequential manner, calling the given function for each item.
3081
3032
  * @param list The list of items to process.