@mozaik-ai/core 4.0.0-beta.4 → 4.0.0-beta.5

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/index.mjs CHANGED
@@ -353,6 +353,9 @@ var Participant = class {
353
353
  getHandlers() {
354
354
  return this.handlers;
355
355
  }
356
+ setHandlers(handlers) {
357
+ this.handlers = handlers;
358
+ }
356
359
  };
357
360
 
358
361
  // src/domain/agentic-environment/participant/memory.ts
@@ -1044,7 +1047,14 @@ import Anthropic from "@anthropic-ai/sdk";
1044
1047
  var AnthropicMessages = class {
1045
1048
  constructor(endpointMapper = new AnthropicMessagesMapper(), config = {}) {
1046
1049
  this.endpointMapper = endpointMapper;
1047
- this.client = new Anthropic({ baseURL: config.baseURL, apiKey: config.apiKey });
1050
+ this.clientConfig = config;
1051
+ }
1052
+ get client() {
1053
+ var _a;
1054
+ return (_a = this._client) != null ? _a : this._client = new Anthropic({
1055
+ baseURL: this.clientConfig.baseURL,
1056
+ apiKey: this.clientConfig.apiKey
1057
+ });
1048
1058
  }
1049
1059
  async infer(inferenceInput) {
1050
1060
  const request = this.endpointMapper.toRequest(inferenceInput);
@@ -1225,7 +1235,10 @@ var OpenAIResponsesMapper = class {
1225
1235
  var OpenAIResponses = class {
1226
1236
  constructor(endpointMapper = new OpenAIResponsesMapper()) {
1227
1237
  this.endpointMapper = endpointMapper;
1228
- this.client = new OpenAI();
1238
+ }
1239
+ get client() {
1240
+ var _a;
1241
+ return (_a = this._client) != null ? _a : this._client = new OpenAI();
1229
1242
  }
1230
1243
  async infer(inferenceInput) {
1231
1244
  const request = this.endpointMapper.toRequest(inferenceInput);
@@ -1408,11 +1421,14 @@ var GeminiGenerateContentMapper = class {
1408
1421
  // src/infrastructure/providers/gemini/endpoints/gemini-generate-content.ts
1409
1422
  var GeminiGenerateContent = class {
1410
1423
  constructor(endpointMapper = new GeminiGenerateContentMapper(), config = {}) {
1411
- var _a;
1412
1424
  this.endpointMapper = endpointMapper;
1413
- this.client = new GoogleGenAI({
1414
- apiKey: (_a = config.apiKey) != null ? _a : process.env.GEMINI_API_KEY,
1415
- ...config.baseURL ? { httpOptions: { baseUrl: config.baseURL } } : {}
1425
+ this.clientConfig = config;
1426
+ }
1427
+ get client() {
1428
+ var _a, _b;
1429
+ return (_b = this._client) != null ? _b : this._client = new GoogleGenAI({
1430
+ apiKey: (_a = this.clientConfig.apiKey) != null ? _a : process.env.GEMINI_API_KEY,
1431
+ ...this.clientConfig.baseURL ? { httpOptions: { baseUrl: this.clientConfig.baseURL } } : {}
1416
1432
  });
1417
1433
  }
1418
1434
  async infer(inferenceInput) {
@@ -1554,12 +1570,16 @@ var OpenAIChatCompletions = class {
1554
1570
  constructor(endpointMapper = new OpenAIChatCompletionsMapper(), config = {}) {
1555
1571
  var _a;
1556
1572
  this.endpointMapper = endpointMapper;
1557
- this.client = new OpenAI2({
1558
- baseURL: config.baseURL,
1559
- apiKey: config.apiKey
1560
- });
1573
+ this.clientConfig = config;
1561
1574
  this.extraBody = (_a = config.extraBody) != null ? _a : {};
1562
1575
  }
1576
+ get client() {
1577
+ var _a;
1578
+ return (_a = this._client) != null ? _a : this._client = new OpenAI2({
1579
+ baseURL: this.clientConfig.baseURL,
1580
+ apiKey: this.clientConfig.apiKey
1581
+ });
1582
+ }
1563
1583
  buildRequest(inferenceInput) {
1564
1584
  return {
1565
1585
  ...this.extraBody,
@@ -2088,13 +2108,57 @@ function defineRuntime() {
2088
2108
  runLoop
2089
2109
  };
2090
2110
  }
2111
+
2112
+ // src/domain/agentic-environment/situation/situation-specification.ts
2113
+ var SituationSpecification = class {
2114
+ and(other) {
2115
+ return new AndSituationSpecification(this, other);
2116
+ }
2117
+ or(other) {
2118
+ return new OrSituationSpecification(this, other);
2119
+ }
2120
+ not() {
2121
+ return new NotSituationSpecification(this);
2122
+ }
2123
+ };
2124
+ var AndSituationSpecification = class extends SituationSpecification {
2125
+ constructor(left, right) {
2126
+ super();
2127
+ this.left = left;
2128
+ this.right = right;
2129
+ }
2130
+ isSatisfiedBy(situationContext) {
2131
+ return this.left.isSatisfiedBy(situationContext) && this.right.isSatisfiedBy(situationContext);
2132
+ }
2133
+ };
2134
+ var OrSituationSpecification = class extends SituationSpecification {
2135
+ constructor(left, right) {
2136
+ super();
2137
+ this.left = left;
2138
+ this.right = right;
2139
+ }
2140
+ isSatisfiedBy(situationContext) {
2141
+ return this.left.isSatisfiedBy(situationContext) || this.right.isSatisfiedBy(situationContext);
2142
+ }
2143
+ };
2144
+ var NotSituationSpecification = class extends SituationSpecification {
2145
+ constructor(rule) {
2146
+ super();
2147
+ this.rule = rule;
2148
+ }
2149
+ isSatisfiedBy(situationContext) {
2150
+ return !this.rule.isSatisfiedBy(situationContext);
2151
+ }
2152
+ };
2091
2153
  export {
2154
+ Agent,
2092
2155
  AnthropicMessages,
2093
2156
  ContextItem,
2094
2157
  DeveloperMessageItem,
2095
2158
  FunctionCallItem,
2096
2159
  FunctionCallOutputItem,
2097
2160
  GeminiGenerateContent,
2161
+ Human,
2098
2162
  InputTokenDetails,
2099
2163
  McpClient,
2100
2164
  McpToolRegistry,
@@ -2107,6 +2171,7 @@ export {
2107
2171
  ReasoningItem,
2108
2172
  RuntimeState,
2109
2173
  SemanticEvent,
2174
+ SituationSpecification,
2110
2175
  SystemMessageItem,
2111
2176
  TokenUsage,
2112
2177
  UserMessageItem,