@mozaik-ai/core 4.0.0-beta.4 → 4.0.0-beta.6
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.d.mts +34 -7
- package/dist/index.d.ts +34 -7
- package/dist/index.js +80 -17
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +76 -17
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
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
|
|
@@ -789,34 +792,27 @@ var EventPublisherLoopVisitor = class {
|
|
|
789
792
|
this.runtime = runtime;
|
|
790
793
|
}
|
|
791
794
|
visitContextPreparationStarted(input) {
|
|
792
|
-
console.log("Visiting message received started: ", input);
|
|
793
795
|
this.publish("context_preparation.started", input);
|
|
794
796
|
}
|
|
795
797
|
visitContextPreparationCompleted(output) {
|
|
796
|
-
console.log("Visiting message received completed: ", output);
|
|
797
798
|
this.publish("context_preparation.completed", output);
|
|
798
799
|
}
|
|
799
800
|
visitInferenceStarted(input) {
|
|
800
|
-
console.log("Visiting inference started: ", input);
|
|
801
801
|
this.publish("inference.started", input);
|
|
802
802
|
}
|
|
803
803
|
visitInferenceEvent(event) {
|
|
804
804
|
this.publish("inference.stream", event);
|
|
805
805
|
}
|
|
806
806
|
visitInferenceCompleted(output) {
|
|
807
|
-
console.log("Visiting inference completed: ", output);
|
|
808
807
|
this.publish("inference.completed", output);
|
|
809
808
|
}
|
|
810
809
|
visitFunctionCallStarted(input) {
|
|
811
|
-
console.log("Visiting function call started: ", input);
|
|
812
810
|
this.publish("function_call.started", input);
|
|
813
811
|
}
|
|
814
812
|
visitFunctionCallCompleted(output) {
|
|
815
|
-
console.log("Visiting function call completed: ", output);
|
|
816
813
|
this.publish("function_call.completed", output);
|
|
817
814
|
}
|
|
818
815
|
visitModelAnswer(input) {
|
|
819
|
-
console.log("Visiting model answer: ", input.answer);
|
|
820
816
|
this.publish("model.answer", input);
|
|
821
817
|
}
|
|
822
818
|
publish(type, payload) {
|
|
@@ -1044,7 +1040,14 @@ import Anthropic from "@anthropic-ai/sdk";
|
|
|
1044
1040
|
var AnthropicMessages = class {
|
|
1045
1041
|
constructor(endpointMapper = new AnthropicMessagesMapper(), config = {}) {
|
|
1046
1042
|
this.endpointMapper = endpointMapper;
|
|
1047
|
-
this.
|
|
1043
|
+
this.clientConfig = config;
|
|
1044
|
+
}
|
|
1045
|
+
get client() {
|
|
1046
|
+
var _a;
|
|
1047
|
+
return (_a = this._client) != null ? _a : this._client = new Anthropic({
|
|
1048
|
+
baseURL: this.clientConfig.baseURL,
|
|
1049
|
+
apiKey: this.clientConfig.apiKey
|
|
1050
|
+
});
|
|
1048
1051
|
}
|
|
1049
1052
|
async infer(inferenceInput) {
|
|
1050
1053
|
const request = this.endpointMapper.toRequest(inferenceInput);
|
|
@@ -1225,7 +1228,10 @@ var OpenAIResponsesMapper = class {
|
|
|
1225
1228
|
var OpenAIResponses = class {
|
|
1226
1229
|
constructor(endpointMapper = new OpenAIResponsesMapper()) {
|
|
1227
1230
|
this.endpointMapper = endpointMapper;
|
|
1228
|
-
|
|
1231
|
+
}
|
|
1232
|
+
get client() {
|
|
1233
|
+
var _a;
|
|
1234
|
+
return (_a = this._client) != null ? _a : this._client = new OpenAI();
|
|
1229
1235
|
}
|
|
1230
1236
|
async infer(inferenceInput) {
|
|
1231
1237
|
const request = this.endpointMapper.toRequest(inferenceInput);
|
|
@@ -1408,11 +1414,14 @@ var GeminiGenerateContentMapper = class {
|
|
|
1408
1414
|
// src/infrastructure/providers/gemini/endpoints/gemini-generate-content.ts
|
|
1409
1415
|
var GeminiGenerateContent = class {
|
|
1410
1416
|
constructor(endpointMapper = new GeminiGenerateContentMapper(), config = {}) {
|
|
1411
|
-
var _a;
|
|
1412
1417
|
this.endpointMapper = endpointMapper;
|
|
1413
|
-
this.
|
|
1414
|
-
|
|
1415
|
-
|
|
1418
|
+
this.clientConfig = config;
|
|
1419
|
+
}
|
|
1420
|
+
get client() {
|
|
1421
|
+
var _a, _b;
|
|
1422
|
+
return (_b = this._client) != null ? _b : this._client = new GoogleGenAI({
|
|
1423
|
+
apiKey: (_a = this.clientConfig.apiKey) != null ? _a : process.env.GEMINI_API_KEY,
|
|
1424
|
+
...this.clientConfig.baseURL ? { httpOptions: { baseUrl: this.clientConfig.baseURL } } : {}
|
|
1416
1425
|
});
|
|
1417
1426
|
}
|
|
1418
1427
|
async infer(inferenceInput) {
|
|
@@ -1554,12 +1563,16 @@ var OpenAIChatCompletions = class {
|
|
|
1554
1563
|
constructor(endpointMapper = new OpenAIChatCompletionsMapper(), config = {}) {
|
|
1555
1564
|
var _a;
|
|
1556
1565
|
this.endpointMapper = endpointMapper;
|
|
1557
|
-
this.
|
|
1558
|
-
baseURL: config.baseURL,
|
|
1559
|
-
apiKey: config.apiKey
|
|
1560
|
-
});
|
|
1566
|
+
this.clientConfig = config;
|
|
1561
1567
|
this.extraBody = (_a = config.extraBody) != null ? _a : {};
|
|
1562
1568
|
}
|
|
1569
|
+
get client() {
|
|
1570
|
+
var _a;
|
|
1571
|
+
return (_a = this._client) != null ? _a : this._client = new OpenAI2({
|
|
1572
|
+
baseURL: this.clientConfig.baseURL,
|
|
1573
|
+
apiKey: this.clientConfig.apiKey
|
|
1574
|
+
});
|
|
1575
|
+
}
|
|
1563
1576
|
buildRequest(inferenceInput) {
|
|
1564
1577
|
return {
|
|
1565
1578
|
...this.extraBody,
|
|
@@ -2088,13 +2101,58 @@ function defineRuntime() {
|
|
|
2088
2101
|
runLoop
|
|
2089
2102
|
};
|
|
2090
2103
|
}
|
|
2104
|
+
|
|
2105
|
+
// src/domain/agentic-environment/situation/situation-specification.ts
|
|
2106
|
+
var SituationSpecification = class {
|
|
2107
|
+
and(other) {
|
|
2108
|
+
return new AndSituationSpecification(this, other);
|
|
2109
|
+
}
|
|
2110
|
+
or(other) {
|
|
2111
|
+
return new OrSituationSpecification(this, other);
|
|
2112
|
+
}
|
|
2113
|
+
not() {
|
|
2114
|
+
return new NotSituationSpecification(this);
|
|
2115
|
+
}
|
|
2116
|
+
};
|
|
2117
|
+
var AndSituationSpecification = class extends SituationSpecification {
|
|
2118
|
+
constructor(left, right) {
|
|
2119
|
+
super();
|
|
2120
|
+
this.left = left;
|
|
2121
|
+
this.right = right;
|
|
2122
|
+
}
|
|
2123
|
+
isSatisfiedBy(situationContext) {
|
|
2124
|
+
return this.left.isSatisfiedBy(situationContext) && this.right.isSatisfiedBy(situationContext);
|
|
2125
|
+
}
|
|
2126
|
+
};
|
|
2127
|
+
var OrSituationSpecification = class extends SituationSpecification {
|
|
2128
|
+
constructor(left, right) {
|
|
2129
|
+
super();
|
|
2130
|
+
this.left = left;
|
|
2131
|
+
this.right = right;
|
|
2132
|
+
}
|
|
2133
|
+
isSatisfiedBy(situationContext) {
|
|
2134
|
+
return this.left.isSatisfiedBy(situationContext) || this.right.isSatisfiedBy(situationContext);
|
|
2135
|
+
}
|
|
2136
|
+
};
|
|
2137
|
+
var NotSituationSpecification = class extends SituationSpecification {
|
|
2138
|
+
constructor(rule) {
|
|
2139
|
+
super();
|
|
2140
|
+
this.rule = rule;
|
|
2141
|
+
}
|
|
2142
|
+
isSatisfiedBy(situationContext) {
|
|
2143
|
+
return !this.rule.isSatisfiedBy(situationContext);
|
|
2144
|
+
}
|
|
2145
|
+
};
|
|
2091
2146
|
export {
|
|
2147
|
+
Agent,
|
|
2092
2148
|
AnthropicMessages,
|
|
2093
2149
|
ContextItem,
|
|
2150
|
+
DefaultInferenceRunner,
|
|
2094
2151
|
DeveloperMessageItem,
|
|
2095
2152
|
FunctionCallItem,
|
|
2096
2153
|
FunctionCallOutputItem,
|
|
2097
2154
|
GeminiGenerateContent,
|
|
2155
|
+
Human,
|
|
2098
2156
|
InputTokenDetails,
|
|
2099
2157
|
McpClient,
|
|
2100
2158
|
McpToolRegistry,
|
|
@@ -2107,6 +2165,7 @@ export {
|
|
|
2107
2165
|
ReasoningItem,
|
|
2108
2166
|
RuntimeState,
|
|
2109
2167
|
SemanticEvent,
|
|
2168
|
+
SituationSpecification,
|
|
2110
2169
|
SystemMessageItem,
|
|
2111
2170
|
TokenUsage,
|
|
2112
2171
|
UserMessageItem,
|