@ziggs-ai/ziggs-mcp 0.30.3 → 0.31.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/dist/toolPick.d.ts +1 -25
- package/dist/toolPick.js +1 -34
- package/package.json +2 -2
package/dist/toolPick.d.ts
CHANGED
|
@@ -1,27 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
/** One catalog row as the picker reads it. */
|
|
3
|
-
export interface ToolPickOption {
|
|
4
|
-
name: string;
|
|
5
|
-
line: string;
|
|
6
|
-
}
|
|
7
|
-
/**
|
|
8
|
-
* - `pick` one tool does the need: `tool` names it.
|
|
9
|
-
* - `nothing_fits` no tool does it.
|
|
10
|
-
* - `unsure` / `off` no answer worth giving: show the list.
|
|
11
|
-
*/
|
|
12
|
-
export interface ToolPickAnswer {
|
|
13
|
-
how: 'pick' | 'nothing_fits' | 'unsure' | 'off';
|
|
14
|
-
tool?: string;
|
|
15
|
-
confidence?: number;
|
|
16
|
-
}
|
|
17
|
-
/** Null means "no answer": the surface shows the list it always has. */
|
|
18
|
-
export type PickTool = (need: string, options: ToolPickOption[]) => Promise<ToolPickAnswer | null>;
|
|
19
|
-
/**
|
|
20
|
-
* The backend picker: `POST /internal/tool-pick` with this connection's key.
|
|
21
|
-
* The model call and its key live on the backend, since this server also runs
|
|
22
|
-
* on a caller's own machine. Any failure is null, including the 404 from a
|
|
23
|
-
* backend that predates the route.
|
|
24
|
-
*/
|
|
25
|
-
export declare function backendToolPick(creds: Creds): PickTool;
|
|
1
|
+
export { backendToolPick, type ToolPickOption, type ToolPickAnswer, type PickTool } from '@ziggs-ai/api-client';
|
|
26
2
|
/** What the picker is told a tool does: its title and the first sentence it says. */
|
|
27
3
|
export declare function pickLine(title: string, description: string): string;
|
package/dist/toolPick.js
CHANGED
|
@@ -1,37 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
/** A listing is always the fallback, so waiting long for a pick buys nothing. */
|
|
3
|
-
const TIMEOUT_MS = 6000;
|
|
4
|
-
/**
|
|
5
|
-
* The backend picker: `POST /internal/tool-pick` with this connection's key.
|
|
6
|
-
* The model call and its key live on the backend, since this server also runs
|
|
7
|
-
* on a caller's own machine. Any failure is null, including the 404 from a
|
|
8
|
-
* backend that predates the route.
|
|
9
|
-
*/
|
|
10
|
-
export function backendToolPick(creds) {
|
|
11
|
-
return async (need, options) => {
|
|
12
|
-
if (!creds.operatorKey)
|
|
13
|
-
return null;
|
|
14
|
-
try {
|
|
15
|
-
const res = await fetch(`${getBackendUrl()}/internal/tool-pick`, {
|
|
16
|
-
method: 'POST',
|
|
17
|
-
headers: buildCredsHeaders(creds),
|
|
18
|
-
body: JSON.stringify({ need, options }),
|
|
19
|
-
signal: AbortSignal.timeout(TIMEOUT_MS),
|
|
20
|
-
});
|
|
21
|
-
if (!res.ok) {
|
|
22
|
-
await res.body?.cancel().catch(() => undefined);
|
|
23
|
-
return null;
|
|
24
|
-
}
|
|
25
|
-
const data = (await res.json().catch(() => null));
|
|
26
|
-
if (!data || typeof data.how !== 'string')
|
|
27
|
-
return null;
|
|
28
|
-
return data;
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
return null;
|
|
32
|
-
}
|
|
33
|
-
};
|
|
34
|
-
}
|
|
1
|
+
export { backendToolPick } from '@ziggs-ai/api-client';
|
|
35
2
|
/** What the picker is told a tool does: its title and the first sentence it says. */
|
|
36
3
|
export function pickLine(title, description) {
|
|
37
4
|
const first = description.split(/(?<=\.)\s/)[0] ?? '';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ziggs-ai/ziggs-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.31.0",
|
|
4
4
|
"description": "MCP server for Claude Code, Cursor, and other MCP hosts — act as your Ziggs delegate agent",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
41
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
42
|
-
"@ziggs-ai/api-client": "0.
|
|
42
|
+
"@ziggs-ai/api-client": "0.31.0",
|
|
43
43
|
"dotenv": "^16.6.1",
|
|
44
44
|
"zod": "^3.24.2",
|
|
45
45
|
"zod-to-json-schema": "^3.25.1"
|