Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions packages/mcp-manager/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ export interface McpRuntimeCapabilitiesSnapshot {
readonly subscriptions: boolean;
}

/**
* Normalized immutable projection of one managed runtime's lifecycle state.
*
* Optional properties are absent rather than present with an `undefined` value.
* The snapshot and its nested capability projection are frozen.
*/
export interface McpRuntimeStateSnapshot {
readonly phase: McpRuntimePhase;
readonly lastTransitionAt: string;
Expand Down
6 changes: 6 additions & 0 deletions packages/mcp-manager/tests/runtime-manager.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,12 @@ describe("McpRuntimeManager", () => {
expect(mcpRuntimeStateSnapshotSchema["~standard"].validate(offline)).toEqual({
value: offline,
});

for (const state of [online, untracked, degraded, offline]) {
expect(Object.isFrozen(state)).toBe(true);
expect(Object.values(state)).not.toContain(undefined);
}
expect(Object.isFrozen(online.capabilities)).toBe(true);
await manager.close();
});

Expand Down