infomentor-se-mcp 1.3.0 → 1.3.1
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/CHANGELOG.md +7 -0
- package/README.md +6 -8
- package/dist/collection.js +15 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.3.1
|
|
4
|
+
|
|
5
|
+
- Attribute account-wide notification feed entries only to their declared pupil,
|
|
6
|
+
not whichever child is selected when the feed is read. Repeated cross-child
|
|
7
|
+
copies cannot create foreign-child calendar-week updates; conflicting week
|
|
8
|
+
detail identities remain pending without accepting the foreign payload.
|
|
9
|
+
|
|
3
10
|
## 1.3.0
|
|
4
11
|
|
|
5
12
|
- Add default `infomentor_read_news_attachment`: exact-child fresh-feed
|
package/README.md
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
# InfoMentor MCP
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
The last verified npm release is `1.2.0`. Version-pinned `1.3.0` examples below
|
|
5
|
-
require the matching release to be published first.
|
|
3
|
+
Current release: `1.3.1`. See [CHANGELOG.md](CHANGELOG.md) for release notes.
|
|
6
4
|
|
|
7
5
|
A local MCP server for Swedish InfoMentor parent accounts. It uses InfoMentor's
|
|
8
6
|
HTTPS endpoints directly; it does not use Playwright, browser automation, or a
|
|
@@ -62,8 +60,8 @@ are required; Bun is not required.
|
|
|
62
60
|
First verify the package from a terminal:
|
|
63
61
|
|
|
64
62
|
```sh
|
|
65
|
-
npx -y infomentor-se-mcp@1.3.
|
|
66
|
-
npx -y infomentor-se-mcp@1.3.
|
|
63
|
+
npx -y infomentor-se-mcp@1.3.1 --version
|
|
64
|
+
npx -y infomentor-se-mcp@1.3.1 --help
|
|
67
65
|
```
|
|
68
66
|
|
|
69
67
|
Then add the server to the MCP host's configuration. This is the standard
|
|
@@ -74,7 +72,7 @@ stdio shape used by Claude Desktop, Cursor, Hermes, and other MCP hosts:
|
|
|
74
72
|
"mcpServers": {
|
|
75
73
|
"infomentor": {
|
|
76
74
|
"command": "npx",
|
|
77
|
-
"args": ["-y", "infomentor-se-mcp@1.3.
|
|
75
|
+
"args": ["-y", "infomentor-se-mcp@1.3.1"],
|
|
78
76
|
"env": {
|
|
79
77
|
"INFOMENTOR_SE_SESSION_PATH": "/absolute/path/infomentor-session.json",
|
|
80
78
|
"INFOMENTOR_SE_CREDENTIALS_FILE": "/absolute/path/credentials.json"
|
|
@@ -84,7 +82,7 @@ stdio shape used by Claude Desktop, Cursor, Hermes, and other MCP hosts:
|
|
|
84
82
|
}
|
|
85
83
|
```
|
|
86
84
|
|
|
87
|
-
Use absolute paths. The exact `@1.3.
|
|
85
|
+
Use absolute paths. The exact `@1.3.1` version keeps the host reproducible;
|
|
88
86
|
change it deliberately when upgrading. `@latest` is also supported when you
|
|
89
87
|
prefer automatic adoption of the newest published version.
|
|
90
88
|
|
|
@@ -97,7 +95,7 @@ MCP host after changing its command or environment.
|
|
|
97
95
|
To expose the opt-in advanced tools, add the `serve` command and flag:
|
|
98
96
|
|
|
99
97
|
```json
|
|
100
|
-
"args": ["-y", "infomentor-se-mcp@1.3.
|
|
98
|
+
"args": ["-y", "infomentor-se-mcp@1.3.1", "serve", "--allow-advanced-tools"]
|
|
101
99
|
```
|
|
102
100
|
|
|
103
101
|
Only enable `--allow-setup-tools` when the host must expose login, setup-status,
|
package/dist/collection.js
CHANGED
|
@@ -5,7 +5,7 @@ import { ensurePrivateDir, readPrivateFile, sweepTempInDirectory, writePrivateFi
|
|
|
5
5
|
import { z } from "zod";
|
|
6
6
|
import { attendanceDetailSchema } from "./attendance.js";
|
|
7
7
|
import { calendarEventSchema, isCalendarNotification, calendarEventIdFromNotificationUrl, calendarWeekSchema, } from "./calendar.js";
|
|
8
|
-
import { newsItemSchema } from "./news.js";
|
|
8
|
+
import { childIdFromPupilSourceId, newsItemSchema } from "./news.js";
|
|
9
9
|
import { InfoMentorError, PARENT_URL, messageDetailSchema, messagesPageSchema, notificationsDataSchema, notificationSchema, pupilSchema, sessionPath, timetableSchema, throwIfAborted, timetableEntrySchema, } from "./session.js";
|
|
10
10
|
export const collectRequestSchema = z
|
|
11
11
|
.object({
|
|
@@ -270,6 +270,12 @@ async function resolveCollectedNotification(item, source, signal) {
|
|
|
270
270
|
if (!source.resolveCalendarWeek)
|
|
271
271
|
throw new InfoMentorError("INVALID_CONFIGURATION", "The collection source cannot resolve calendar weeks.");
|
|
272
272
|
const detail = calendarWeekSchema.parse(await source.resolveCalendarWeek(item.id, signal, item));
|
|
273
|
+
if (detail.childId !== (childIdFromPupilSourceId(item.pupilSourceId) ?? item.pupilSourceId) ||
|
|
274
|
+
detail.notification.id !== item.id ||
|
|
275
|
+
detail.notification.pupilSourceId !== item.pupilSourceId ||
|
|
276
|
+
detail.notification.type !== item.type ||
|
|
277
|
+
detail.events.some((event) => event.childId !== detail.childId))
|
|
278
|
+
throw new InfoMentorError("UNEXPECTED_PAGE", "InfoMentor returned calendar week details with a conflicting child or notification identity.");
|
|
273
279
|
return collectedNotificationSchema.parse({
|
|
274
280
|
...item,
|
|
275
281
|
detailStatus: detail.skipped > 0 ? "pending" : "resolved",
|
|
@@ -408,6 +414,14 @@ export async function collectUpdates(request, source) {
|
|
|
408
414
|
const notificationFeed = notificationsDataSchema.parse(await source.getNotifications(signal));
|
|
409
415
|
skippedByFeed.notifications += notificationFeed.skipped;
|
|
410
416
|
for (const item of notificationFeed.notifications) {
|
|
417
|
+
// The notification feed is account-wide, not selected-child scoped.
|
|
418
|
+
// Resolve and fingerprint each reference only in its declared pupil's
|
|
419
|
+
// scan; presentation state can differ in another child's copy.
|
|
420
|
+
const notificationChildId = childIdFromPupilSourceId(item.pupilSourceId) ?? item.pupilSourceId;
|
|
421
|
+
if (!initial.account.pupils.some((pupil) => pupil.id === notificationChildId))
|
|
422
|
+
throw new InfoMentorError("UNEXPECTED_PAGE", "InfoMentor returned a notification with an unknown child. No cursor was advanced.");
|
|
423
|
+
if (notificationChildId !== child.id)
|
|
424
|
+
continue;
|
|
411
425
|
const sourceId = JSON.stringify([item.pupilSourceId, item.id]);
|
|
412
426
|
const { currentlySelectedPupil: _currentlySelectedPupil, ...summary } = item;
|
|
413
427
|
const summaryHash = hash(JSON.stringify(summary));
|