@almadar/runtime 6.26.0 → 6.28.0
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/dist/{OrbitalServerRuntime-h0NCwFuc.d.ts → OrbitalServerRuntime-DCkk0alk.d.ts} +50 -2
- package/dist/OrbitalServerRuntime.d.ts +2 -2
- package/dist/OrbitalServerRuntime.js +31 -2
- package/dist/OrbitalServerRuntime.js.map +1 -1
- package/dist/ServerBridge.d.ts +1 -1
- package/dist/{chunk-YNRDYK3N.js → chunk-FWBY567U.js} +101 -5
- package/dist/chunk-FWBY567U.js.map +1 -0
- package/dist/createAgentSubstrateHandlers-4JMLGDZQ.js +71 -0
- package/dist/createAgentSubstrateHandlers-4JMLGDZQ.js.map +1 -0
- package/dist/createOsHandlers.d.ts +1 -1
- package/dist/index.d.ts +10 -5
- package/dist/index.js +2 -2
- package/dist/{types-BA7GoDni.d.ts → types-CguyGOms.d.ts} +24 -1
- package/package.json +2 -2
- package/dist/chunk-YNRDYK3N.js.map +0 -1
package/dist/ServerBridge.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { parseCron, cronMinuteKey, cronMatches } from './chunk-U4PL237A.js';
|
|
2
2
|
import { createLogger, setNamespaceLevel } from '@almadar/logger';
|
|
3
|
-
import { resolveBinding, evaluate, createMinimalContext, evaluateGuard } from '@almadar/evaluator';
|
|
3
|
+
import { resolveBinding, evaluate, createMinimalContext, evaluateGuard, SExpressionEvaluator } from '@almadar/evaluator';
|
|
4
4
|
export { createMinimalContext } from '@almadar/evaluator';
|
|
5
5
|
import { isKnownStdOperator } from '@almadar/std/registry';
|
|
6
6
|
import { isCallSiteConfigDeclaration, OrbitalSchemaSchema, isInlineTrait, isEntityCall, isEntityReference, parseEntityRef, parseImportedTraitRef, isPageReference, isPageReferenceString, isPageReferenceObject, parsePageRef } from '@almadar/core';
|
|
@@ -1029,6 +1029,7 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1029
1029
|
debug;
|
|
1030
1030
|
strictBindings;
|
|
1031
1031
|
contextExtensions;
|
|
1032
|
+
evaluator;
|
|
1032
1033
|
constructor(options) {
|
|
1033
1034
|
this.handlers = options.handlers;
|
|
1034
1035
|
this.bindings = options.bindings;
|
|
@@ -1036,6 +1037,15 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1036
1037
|
this.debug = options.debug ?? false;
|
|
1037
1038
|
this.strictBindings = options.strictBindings ?? false;
|
|
1038
1039
|
this.contextExtensions = options.contextExtensions;
|
|
1040
|
+
this.evaluator = options.evaluator;
|
|
1041
|
+
}
|
|
1042
|
+
_evaluator;
|
|
1043
|
+
getEvaluator() {
|
|
1044
|
+
if (this.evaluator) return this.evaluator;
|
|
1045
|
+
if (!this._evaluator) {
|
|
1046
|
+
this._evaluator = new SExpressionEvaluator();
|
|
1047
|
+
}
|
|
1048
|
+
return this._evaluator;
|
|
1039
1049
|
}
|
|
1040
1050
|
// ==========================================================================
|
|
1041
1051
|
// Handler Manifest Validation (RCG-03)
|
|
@@ -1132,7 +1142,19 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1132
1142
|
resolvedArgs = args;
|
|
1133
1143
|
} else if (isSetPathForm) {
|
|
1134
1144
|
const ctx = createContextFromBindings(this.bindings, this.strictBindings, this.contextExtensions);
|
|
1135
|
-
|
|
1145
|
+
const resolvedRest = [];
|
|
1146
|
+
for (const a of args.slice(1)) {
|
|
1147
|
+
if (Array.isArray(a) && a.length > 0 && typeof a[0] === "string") {
|
|
1148
|
+
let result = this.getEvaluator().evaluate(a, ctx);
|
|
1149
|
+
if (result instanceof Promise) {
|
|
1150
|
+
result = await result;
|
|
1151
|
+
}
|
|
1152
|
+
resolvedRest.push(result);
|
|
1153
|
+
} else {
|
|
1154
|
+
resolvedRest.push(interpolateValue(a, ctx));
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
resolvedArgs = [args[0], ...resolvedRest];
|
|
1136
1158
|
} else if (isFetchLike) {
|
|
1137
1159
|
const ctx = createContextFromBindings(this.bindings, this.strictBindings, this.contextExtensions);
|
|
1138
1160
|
const opts = args[1];
|
|
@@ -1800,8 +1822,82 @@ var EffectExecutor = class _EffectExecutor {
|
|
|
1800
1822
|
}
|
|
1801
1823
|
break;
|
|
1802
1824
|
}
|
|
1825
|
+
// === Agent substrate operators (server-side, effect-position) ===
|
|
1826
|
+
case "compose/compose-all": {
|
|
1827
|
+
if (this.handlers.substrateComposeAll) {
|
|
1828
|
+
const config = args[0];
|
|
1829
|
+
await this.handlers.substrateComposeAll(config);
|
|
1830
|
+
} else {
|
|
1831
|
+
this.logUnsupported("compose/compose-all");
|
|
1832
|
+
}
|
|
1833
|
+
break;
|
|
1834
|
+
}
|
|
1835
|
+
case "compose/compose-children": {
|
|
1836
|
+
if (this.handlers.substrateComposeChildren) {
|
|
1837
|
+
const parentName = args[0];
|
|
1838
|
+
const children = args[1];
|
|
1839
|
+
await this.handlers.substrateComposeChildren(parentName, children);
|
|
1840
|
+
} else {
|
|
1841
|
+
this.logUnsupported("compose/compose-children");
|
|
1842
|
+
}
|
|
1843
|
+
break;
|
|
1844
|
+
}
|
|
1845
|
+
case "behavior/instantiate": {
|
|
1846
|
+
if (this.handlers.substrateInstantiate) {
|
|
1847
|
+
const parentName = args[0];
|
|
1848
|
+
const behavior = args[1];
|
|
1849
|
+
const params = args.length > 2 ? args[2] : void 0;
|
|
1850
|
+
await this.handlers.substrateInstantiate(parentName, behavior, params);
|
|
1851
|
+
} else {
|
|
1852
|
+
this.logUnsupported("behavior/instantiate");
|
|
1853
|
+
}
|
|
1854
|
+
break;
|
|
1855
|
+
}
|
|
1856
|
+
case "behavior/call": {
|
|
1857
|
+
if (this.handlers.substrateCall) {
|
|
1858
|
+
const behavior = args[0];
|
|
1859
|
+
const method = args[1];
|
|
1860
|
+
const params = args.length > 2 ? args[2] : void 0;
|
|
1861
|
+
await this.handlers.substrateCall(behavior, method, params);
|
|
1862
|
+
} else {
|
|
1863
|
+
this.logUnsupported("behavior/call");
|
|
1864
|
+
}
|
|
1865
|
+
break;
|
|
1866
|
+
}
|
|
1867
|
+
case "validate/validate": {
|
|
1868
|
+
if (this.handlers.substrateValidate) {
|
|
1869
|
+
const orbitalName = args[0];
|
|
1870
|
+
await this.handlers.substrateValidate(orbitalName);
|
|
1871
|
+
} else {
|
|
1872
|
+
this.logUnsupported("validate/validate");
|
|
1873
|
+
}
|
|
1874
|
+
break;
|
|
1875
|
+
}
|
|
1876
|
+
case "lolo/emit-body": {
|
|
1877
|
+
if (this.handlers.substrateEmitBody) {
|
|
1878
|
+
const orbitalName = args[0];
|
|
1879
|
+
const loloSource = args[1];
|
|
1880
|
+
await this.handlers.substrateEmitBody(orbitalName, loloSource);
|
|
1881
|
+
} else {
|
|
1882
|
+
this.logUnsupported("lolo/emit-body");
|
|
1883
|
+
}
|
|
1884
|
+
break;
|
|
1885
|
+
}
|
|
1803
1886
|
default: {
|
|
1804
|
-
if (
|
|
1887
|
+
if (operator.includes("/")) {
|
|
1888
|
+
const ctx = createContextFromBindings(
|
|
1889
|
+
this.bindings,
|
|
1890
|
+
this.strictBindings,
|
|
1891
|
+
this.contextExtensions
|
|
1892
|
+
);
|
|
1893
|
+
const result = this.getEvaluator().evaluate(
|
|
1894
|
+
[operator, ...args],
|
|
1895
|
+
ctx
|
|
1896
|
+
);
|
|
1897
|
+
if (result instanceof Promise) {
|
|
1898
|
+
await result;
|
|
1899
|
+
}
|
|
1900
|
+
} else if (this.debug) {
|
|
1805
1901
|
effectLog.warn("unknown-operator", { operator });
|
|
1806
1902
|
}
|
|
1807
1903
|
}
|
|
@@ -3901,5 +3997,5 @@ var InMemoryPersistence = class {
|
|
|
3901
3997
|
};
|
|
3902
3998
|
|
|
3903
3999
|
export { EffectExecutor, EventBus, HANDLER_MANIFEST, InMemoryPersistence, MockPersistenceAdapter, StateMachineManager, TickScheduler, buildEmitsFromTraits, collectDeclaredConfigDefaults, collectDeclaredEntityDefaults, containsBindings, createContextFromBindings, createInitialTraitState, createMockPersistence, createTestExecutor, createTickScheduler, createUnifiedLoader, extractBindings, findInitialState, findTransition, formatPayloadValidationError, getIsolatedCollectionName, getNamespacedEvent, interpolateProps, interpolateValue, isBrowser, isElectron, isNamespacedEvent, isNode, isValidDurationString, normalizeCallSiteConfigToValues, normalizeEventKey, parseDurationString, parseNamespacedEvent, preprocessSchema, processEvent, validateEventPayload, validatePayloadShapes };
|
|
3904
|
-
//# sourceMappingURL=chunk-
|
|
3905
|
-
//# sourceMappingURL=chunk-
|
|
4000
|
+
//# sourceMappingURL=chunk-FWBY567U.js.map
|
|
4001
|
+
//# sourceMappingURL=chunk-FWBY567U.js.map
|