@klhapp/skillmux 1.3.3 → 1.3.4
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/docs/schema.json +1 -2
- package/package.json +1 -1
- package/src/server.ts +46 -40
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,13 @@ All notable changes to this project are documented in this file.
|
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
7
|
|
|
8
|
+
## [1.3.4](https://github.com/klhq/skillmux/compare/v1.3.3...v1.3.4) (2026-08-02)
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
* **schema:** align published contract with server and guard GBNF bounds ([#104](https://github.com/klhq/skillmux/issues/104)) ([eb33613](https://github.com/klhq/skillmux/commit/eb336136a77c96fe5b660532dfbe191134e55ed3))
|
|
14
|
+
|
|
8
15
|
## [1.3.3](https://github.com/klhq/skillmux/compare/v1.3.2...v1.3.3) (2026-08-02)
|
|
9
16
|
|
|
10
17
|
|
package/docs/schema.json
CHANGED
package/package.json
CHANGED
package/src/server.ts
CHANGED
|
@@ -64,46 +64,7 @@ function safeTokenEquals(a: string, b: string): boolean {
|
|
|
64
64
|
return timingSafeEqual(bufA, bufB);
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
export
|
|
68
|
-
transport?: "stdio" | "http";
|
|
69
|
-
port?: number;
|
|
70
|
-
config?: Config;
|
|
71
|
-
clients?: Partial<Clients>;
|
|
72
|
-
configPath?: string;
|
|
73
|
-
}): Promise<ServerHandle> {
|
|
74
|
-
const configPath = resolveConfigPath(opts?.configPath);
|
|
75
|
-
const config = opts?.config ?? (await loadConfig(configPath));
|
|
76
|
-
const initialClients = { ...createClients(config), ...opts?.clients };
|
|
77
|
-
const snapshots = RuntimeSnapshotManager.create(config, initialClients);
|
|
78
|
-
const inactiveReloadStatus: ReloadStatus = {
|
|
79
|
-
last_successful_reload_at: null,
|
|
80
|
-
last_reload_error: null,
|
|
81
|
-
restart_required_keys: [],
|
|
82
|
-
};
|
|
83
|
-
configure({ config, clients: initialClients });
|
|
84
|
-
// An injected config has no guaranteed file source. Watch it only when the
|
|
85
|
-
// caller explicitly supplies that source; normal server startup always watches.
|
|
86
|
-
const watcherPath =
|
|
87
|
-
opts?.configPath ?? (opts?.config ? undefined : configPath);
|
|
88
|
-
const configWatcher = watcherPath
|
|
89
|
-
? await ConfigWatcher.start(watcherPath, {
|
|
90
|
-
onReload: (nextConfig) => {
|
|
91
|
-
const nextClients = {
|
|
92
|
-
...createClients(nextConfig),
|
|
93
|
-
...opts?.clients,
|
|
94
|
-
};
|
|
95
|
-
snapshots.replace(nextConfig, nextClients);
|
|
96
|
-
configure({ config: nextConfig, clients: nextClients });
|
|
97
|
-
},
|
|
98
|
-
onError: (error) =>
|
|
99
|
-
console.error("skillmux config reload error:", error),
|
|
100
|
-
})
|
|
101
|
-
: undefined;
|
|
102
|
-
const stopWatcher = await startVaultWatcher();
|
|
103
|
-
const initPromise = initializeRuntime(readinessState)
|
|
104
|
-
.then(() => metricsRegistry.setReadiness(readinessState.get()))
|
|
105
|
-
.catch((err) => console.error("skillmux runtime init error:", err));
|
|
106
|
-
|
|
67
|
+
export function createMcpServer(): McpServer {
|
|
107
68
|
const server = new McpServer({ name: "skillmux", version: "0.1.0" });
|
|
108
69
|
|
|
109
70
|
// Transport rule from schema.json: the SKILL.md body appears exactly once on
|
|
@@ -166,6 +127,51 @@ export async function startServer(opts?: {
|
|
|
166
127
|
},
|
|
167
128
|
);
|
|
168
129
|
|
|
130
|
+
return server;
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
export async function startServer(opts?: {
|
|
134
|
+
transport?: "stdio" | "http";
|
|
135
|
+
port?: number;
|
|
136
|
+
config?: Config;
|
|
137
|
+
clients?: Partial<Clients>;
|
|
138
|
+
configPath?: string;
|
|
139
|
+
}): Promise<ServerHandle> {
|
|
140
|
+
const configPath = resolveConfigPath(opts?.configPath);
|
|
141
|
+
const config = opts?.config ?? (await loadConfig(configPath));
|
|
142
|
+
const initialClients = { ...createClients(config), ...opts?.clients };
|
|
143
|
+
const snapshots = RuntimeSnapshotManager.create(config, initialClients);
|
|
144
|
+
const inactiveReloadStatus: ReloadStatus = {
|
|
145
|
+
last_successful_reload_at: null,
|
|
146
|
+
last_reload_error: null,
|
|
147
|
+
restart_required_keys: [],
|
|
148
|
+
};
|
|
149
|
+
configure({ config, clients: initialClients });
|
|
150
|
+
// An injected config has no guaranteed file source. Watch it only when the
|
|
151
|
+
// caller explicitly supplies that source; normal server startup always watches.
|
|
152
|
+
const watcherPath =
|
|
153
|
+
opts?.configPath ?? (opts?.config ? undefined : configPath);
|
|
154
|
+
const configWatcher = watcherPath
|
|
155
|
+
? await ConfigWatcher.start(watcherPath, {
|
|
156
|
+
onReload: (nextConfig) => {
|
|
157
|
+
const nextClients = {
|
|
158
|
+
...createClients(nextConfig),
|
|
159
|
+
...opts?.clients,
|
|
160
|
+
};
|
|
161
|
+
snapshots.replace(nextConfig, nextClients);
|
|
162
|
+
configure({ config: nextConfig, clients: nextClients });
|
|
163
|
+
},
|
|
164
|
+
onError: (error) =>
|
|
165
|
+
console.error("skillmux config reload error:", error),
|
|
166
|
+
})
|
|
167
|
+
: undefined;
|
|
168
|
+
const stopWatcher = await startVaultWatcher();
|
|
169
|
+
const initPromise = initializeRuntime(readinessState)
|
|
170
|
+
.then(() => metricsRegistry.setReadiness(readinessState.get()))
|
|
171
|
+
.catch((err) => console.error("skillmux runtime init error:", err));
|
|
172
|
+
|
|
173
|
+
const server = createMcpServer();
|
|
174
|
+
|
|
169
175
|
const transportType = opts?.transport ?? "stdio";
|
|
170
176
|
if (transportType === "http") {
|
|
171
177
|
const { WebStandardStreamableHTTPServerTransport } =
|