@mozaik-ai/core 3.13.0 → 3.14.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/README.md +189 -129
- package/dist/index.d.mts +154 -579
- package/dist/index.d.ts +154 -579
- package/dist/index.js +1057 -1207
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1055 -1190
- package/dist/index.mjs.map +1 -1
- package/package.json +16 -5
- package/tests/README.md +0 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mozaik-ai/core",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.14.0",
|
|
4
4
|
"description": "A TypeScript framework for building reactive agents",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -34,10 +34,15 @@
|
|
|
34
34
|
"format": "prettier --write \"src/**/*.{ts,tsx}\"",
|
|
35
35
|
"test": "rstest run",
|
|
36
36
|
"test:watch": "rstest watch",
|
|
37
|
-
"test:
|
|
38
|
-
"test:
|
|
37
|
+
"test:domain": "rstest run tests/domain",
|
|
38
|
+
"test:application": "rstest run tests/application",
|
|
39
|
+
"test:infrastructure": "rstest run tests/infrastructure",
|
|
39
40
|
"test:coverage": "rstest run --coverage",
|
|
40
|
-
"prepublishOnly": "npm run build"
|
|
41
|
+
"prepublishOnly": "npm run build",
|
|
42
|
+
"lint": "eslint .",
|
|
43
|
+
"lint:fix": "eslint . --fix",
|
|
44
|
+
"typecheck": "tsc --noEmit",
|
|
45
|
+
"prepare": "husky"
|
|
41
46
|
},
|
|
42
47
|
"keywords": [
|
|
43
48
|
"agentic-environment",
|
|
@@ -55,16 +60,22 @@
|
|
|
55
60
|
],
|
|
56
61
|
"license": "MIT",
|
|
57
62
|
"devDependencies": {
|
|
63
|
+
"@eslint/js": "^10.0.1",
|
|
58
64
|
"@rstest/core": "^0.10.2",
|
|
59
65
|
"@rstest/coverage-istanbul": "^0.10.2",
|
|
66
|
+
"eslint": "^10.4.1",
|
|
67
|
+
"husky": "^9.1.7",
|
|
68
|
+
"lint-staged": "^17.0.7",
|
|
60
69
|
"prettier": "^3.7.4",
|
|
61
70
|
"rimraf": "^5.0.5",
|
|
62
71
|
"tsup": "^8.0.2",
|
|
63
|
-
"typescript": "^5.
|
|
72
|
+
"typescript": "^5.9.3",
|
|
73
|
+
"typescript-eslint": "^8.61.0"
|
|
64
74
|
},
|
|
65
75
|
"dependencies": {
|
|
66
76
|
"@anthropic-ai/sdk": "^0.74.0",
|
|
67
77
|
"@google/genai": "^2.6.0",
|
|
78
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
68
79
|
"dotenv": "^17.4.1",
|
|
69
80
|
"openai": "^6.38.0",
|
|
70
81
|
"zod": "^4.3.6"
|
package/tests/README.md
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
# Tests
|
|
2
|
-
|
|
3
|
-
Mozaik's test suite is split into two layers, runnable independently.
|
|
4
|
-
|
|
5
|
-
| Command | Runs | Scope |
|
|
6
|
-
| --- | --- | --- |
|
|
7
|
-
| `npm run test:unit` | `tests/unit/**` | Domain + application logic in isolation. External dependencies are mocked through their domain ports. |
|
|
8
|
-
| `npm run test:integration` | `tests/integration/**` | Infrastructure layer — concrete provider runtimes (Anthropic Messages, OpenAI Responses, OpenAI-compatible Chat Completions, Gemini generateContent) and the in-memory repository. |
|
|
9
|
-
| `npm test` | everything | Full suite. |
|
|
10
|
-
| `npm run test:coverage` | everything | Adds an Istanbul coverage report under `coverage/`. |
|
|
11
|
-
|
|
12
|
-
## Integration tests do not make network calls
|
|
13
|
-
|
|
14
|
-
Provider runtimes are exercised through their **pure conversion methods**
|
|
15
|
-
(`mapContextToRequest`, `buildRequest`, `extractContextItems`,
|
|
16
|
-
`extractTokenUsage`) — a `ModelContext` of domain items in, a provider-shaped
|
|
17
|
-
request out, and a provider response back into domain items. This is the part
|
|
18
|
-
of the infrastructure layer that breaks silently in production (a malformed
|
|
19
|
-
tool-call shape → a 400 from the provider), so it is asserted exactly without
|
|
20
|
-
touching the wire.
|
|
21
|
-
|
|
22
|
-
`tests/setup.ts` seeds dummy provider API keys so the SDK clients can be
|
|
23
|
-
constructed in CI without real secrets. **Tests must never make a real API
|
|
24
|
-
call** — stub the SDK client if you need to exercise `infer()`/`stream()`
|
|
25
|
-
end to end.
|
|
26
|
-
|
|
27
|
-
## Shared helpers
|
|
28
|
-
|
|
29
|
-
`tests/helpers/` holds reusable doubles (e.g. `RecordingParticipant`, a fake
|
|
30
|
-
`GenerativeModel`). They are excluded from the suite glob, so they are not run
|
|
31
|
-
as test files.
|