@omnidim-ai/mcp-server 0.18.2 → 0.20.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 +6 -0
- package/build/docs-tools.d.ts +12 -0
- package/build/docs-tools.js +105 -0
- package/build/docs-tools.js.map +1 -0
- package/build/helpers.js +39 -7
- package/build/helpers.js.map +1 -1
- package/build/index.d.ts +1 -1
- package/build/index.js +44 -21
- package/build/index.js.map +1 -1
- package/build/procedures.js +64 -39
- package/build/procedures.js.map +1 -1
- package/build/telemetry.d.ts +1 -0
- package/build/telemetry.js +12 -1
- package/build/telemetry.js.map +1 -1
- package/build/tool-annotations.d.ts +5 -0
- package/build/tool-annotations.js +12 -0
- package/build/tool-annotations.js.map +1 -1
- package/package.json +2 -1
- package/src/docs-tools.ts +109 -0
- package/src/helpers.ts +39 -8
- package/src/index.ts +41 -20
- package/src/procedures.ts +64 -39
- package/src/telemetry.ts +15 -1
- package/src/tool-annotations.ts +13 -0
package/build/procedures.js
CHANGED
|
@@ -41,7 +41,14 @@ give it a **phone number** and optionally a **knowledge base**, then place
|
|
|
41
41
|
3. **The agent's numeric \`voice\` field is not used for speech.** It can read
|
|
42
42
|
back as \`false\` on an API-created agent; that is normal. The call handler
|
|
43
43
|
uses \`voice_external_id\` + \`voice_provider\`.
|
|
44
|
-
4. **
|
|
44
|
+
4. **Use the platform defaults:** transcriber \`soniox\`, one of the
|
|
45
|
+
OmniDimension voices, model \`gpt-4.1-mini\`. Pick another provider only when
|
|
46
|
+
the user names one. OmniDimension voices are our most recommended voices:
|
|
47
|
+
picked by our team for each language and tested on real calls. List them
|
|
48
|
+
with \`listVoices\` \`provider=featured\`, best first, and save one as
|
|
49
|
+
\`voice.provider\` = its \`service\` (\`cartesia\`) with its \`name\` as
|
|
50
|
+
\`voice_id\`. A Cartesia \`search\` does not find them. If none fits the
|
|
51
|
+
language or tone, pick another \`cartesia\` voice.
|
|
45
52
|
5. **\`dispatchCall\` returning \`success: true\` does NOT mean a call
|
|
46
53
|
connected.** It means the request was accepted. Proof of a real call is a
|
|
47
54
|
resulting entry in \`listCallLogs\` whose \`getCallLog\` shows a non-empty
|
|
@@ -73,27 +80,37 @@ production, grouped by the language your callers speak. Use \`listSTTProviders\`
|
|
|
73
80
|
|
|
74
81
|
- Default: \`gpt-4.1-mini\` — fast and accurate across languages, a good first
|
|
75
82
|
choice for almost any agent.
|
|
76
|
-
- Alternatives:
|
|
83
|
+
- Alternatives: any other \`name\` from \`listLLMProviders\`, which lists only the
|
|
84
|
+
models your organization can use.
|
|
85
|
+
|
|
86
|
+
## Voice
|
|
87
|
+
|
|
88
|
+
- Default: one of the OmniDimension voices, our most recommended voices. Our
|
|
89
|
+
team picks them for each language and tests them on real calls. List them
|
|
90
|
+
with \`listVoices\` \`provider=featured\`, best first, and save one under its
|
|
91
|
+
\`service\` (\`cartesia\`). See \`omnidim://reference/voices\`.
|
|
77
92
|
|
|
78
93
|
## By caller language
|
|
79
94
|
|
|
80
|
-
- **Indian English (en-IN):** transcriber \`
|
|
81
|
-
(
|
|
95
|
+
- **Indian English (en-IN):** transcriber \`soniox\`; an OmniDimension voice
|
|
96
|
+
for English (India).
|
|
82
97
|
- **Hindi / Hinglish (mixed Hindi and English):** transcriber \`soniox\`
|
|
83
|
-
(handles code-mixed speech in one stream); voice
|
|
84
|
-
- **Other Indian languages (Telugu, Bengali,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
98
|
+
(handles code-mixed speech in one stream); an OmniDimension voice for Hindi.
|
|
99
|
+
- **Other Indian languages (Tamil, Telugu, Marathi, Bengali, Gujarati,
|
|
100
|
+
Kannada, Malayalam, Punjabi):** transcriber \`soniox\`, or \`sarvam\` (tuned for
|
|
101
|
+
Indian languages); an OmniDimension voice for that language.
|
|
102
|
+
- **US English:** transcriber \`soniox\` or \`deepgram_stream\`; an OmniDimension
|
|
103
|
+
voice for English (American).
|
|
104
|
+
- **No OmniDimension voice for the language:** another \`cartesia\` voice.
|
|
88
105
|
|
|
89
106
|
## Field notes
|
|
90
107
|
|
|
91
|
-
- \`transcriber.provider\` is
|
|
92
|
-
|
|
93
|
-
(\`nova-3\` or \`nova-2\`); the others do not.
|
|
94
|
-
- \`voice.provider\` is
|
|
95
|
-
|
|
96
|
-
|
|
108
|
+
- \`transcriber.provider\` is a \`name\` from \`listSTTProviders\`, which lists only
|
|
109
|
+
the transcribers your organization can use. \`deepgram_stream\` also needs a
|
|
110
|
+
\`model\` (\`nova-3\` or \`nova-2\`); the others do not.
|
|
111
|
+
- \`voice.provider\` is the \`service\` of a voice from \`listVoices\`, which lists
|
|
112
|
+
only voices your organization can use. Send only \`provider\` and \`voice_id\`:
|
|
113
|
+
the platform picks the voice model.
|
|
97
114
|
|
|
98
115
|
## Responsiveness
|
|
99
116
|
|
|
@@ -101,26 +118,34 @@ production, grouped by the language your callers speak. Use \`listSTTProviders\`
|
|
|
101
118
|
- Verify your chosen voice on a short test call before launch (see
|
|
102
119
|
\`omnidim://reference/voices\`).
|
|
103
120
|
`;
|
|
104
|
-
// How to choose a voice
|
|
121
|
+
// How to choose a voice: OmniDimension voices first, then other Cartesia voices.
|
|
105
122
|
const VOICES_GUIDE = `# Choosing a voice
|
|
106
123
|
|
|
107
|
-
\`listVoices\` returns the
|
|
108
|
-
\`
|
|
109
|
-
|
|
110
|
-
|
|
124
|
+
\`listVoices\` returns only the voices your organization can use. Use a voice's
|
|
125
|
+
\`name\` field as the \`voice_id\` and its \`service\` as the \`voice.provider\` you
|
|
126
|
+
pass to \`createAgent\`.
|
|
127
|
+
|
|
128
|
+
## Start with OmniDimension voices
|
|
111
129
|
|
|
112
|
-
|
|
113
|
-
|
|
130
|
+
OmniDimension voices are our most recommended voices. Our team picks them for
|
|
131
|
+
each language and tests them on real calls. Use one unless the user asks for
|
|
132
|
+
something else.
|
|
114
133
|
|
|
115
|
-
|
|
134
|
+
- List them with \`listVoices\` \`provider=featured\`. They come back best first.
|
|
135
|
+
- They cover English (India), English (American), Hindi, Tamil, Telugu,
|
|
136
|
+
Marathi, Bengali, Gujarati, Kannada, Malayalam and Punjabi.
|
|
137
|
+
- Each one runs on Cartesia: save it as \`voice.provider\` \`cartesia\` with its
|
|
138
|
+
\`name\` as \`voice_id\`.
|
|
139
|
+
- A Cartesia \`search\` does not find them. Only \`provider=featured\` lists them.
|
|
116
140
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
141
|
+
Example: Aadya, English (India) and Hindi, voice_id
|
|
142
|
+
\`b521b304-7672-4cf9-9a34-b4eb1df1bde0\`.
|
|
143
|
+
|
|
144
|
+
## If none fits
|
|
145
|
+
|
|
146
|
+
Pick another \`cartesia\` voice. \`listVoices\` \`provider=cartesia\` filters by
|
|
147
|
+
\`search\`, \`language\`, \`accent\` and \`gender\`. Not every catalog voice
|
|
148
|
+
synthesizes cleanly, so place a short test call and listen before launch.
|
|
124
149
|
`;
|
|
125
150
|
// The createAgent field shape with two complete, copy-ready examples.
|
|
126
151
|
const AGENT_CONFIG_GUIDE = `# Building an agent with createAgent
|
|
@@ -134,8 +159,8 @@ routing guide). The fields inside:
|
|
|
134
159
|
agent's instructions.
|
|
135
160
|
- \`call_type\` — "Incoming" or "Outgoing".
|
|
136
161
|
- \`model\` — \`{ model, temperature? }\`, e.g. \`{ "model": "gpt-4.1-mini" }\`.
|
|
137
|
-
- \`voice\` — \`{ provider, voice_id
|
|
138
|
-
|
|
162
|
+
- \`voice\` — \`{ provider, voice_id }\`. Start with an OmniDimension voice
|
|
163
|
+
(\`listVoices\` \`provider=featured\`); its \`service\` is the \`provider\`.
|
|
139
164
|
- \`transcriber\` — \`{ provider, model?, language? }\`. \`model\` (\`nova-3\` /
|
|
140
165
|
\`nova-2\`) is only needed for \`deepgram_stream\`.
|
|
141
166
|
|
|
@@ -150,8 +175,8 @@ routing guide). The fields inside:
|
|
|
150
175
|
],
|
|
151
176
|
"call_type": "Incoming",
|
|
152
177
|
"model": { "model": "gpt-4.1-mini" },
|
|
153
|
-
"voice": { "provider": "cartesia", "
|
|
154
|
-
"transcriber": { "provider": "
|
|
178
|
+
"voice": { "provider": "cartesia", "voice_id": "b521b304-7672-4cf9-9a34-b4eb1df1bde0" },
|
|
179
|
+
"transcriber": { "provider": "soniox" }
|
|
155
180
|
}
|
|
156
181
|
}
|
|
157
182
|
|
|
@@ -166,7 +191,7 @@ routing guide). The fields inside:
|
|
|
166
191
|
],
|
|
167
192
|
"call_type": "Outgoing",
|
|
168
193
|
"model": { "model": "gpt-4.1-mini" },
|
|
169
|
-
"voice": { "provider": "cartesia", "
|
|
194
|
+
"voice": { "provider": "cartesia", "voice_id": "<a Hindi voice from listVoices provider=featured>" },
|
|
170
195
|
"transcriber": { "provider": "soniox" }
|
|
171
196
|
}
|
|
172
197
|
}
|
|
@@ -561,7 +586,7 @@ const RESOURCES = [
|
|
|
561
586
|
{
|
|
562
587
|
uri: "omnidim://reference/voices",
|
|
563
588
|
name: "Choosing a voice",
|
|
564
|
-
description: "
|
|
589
|
+
description: "Start with OmniDimension voices (listVoices provider=featured), our most recommended; how to save one, and what to pick when none fits.",
|
|
565
590
|
mimeType: "text/markdown",
|
|
566
591
|
text: VOICES_GUIDE,
|
|
567
592
|
},
|
|
@@ -650,7 +675,7 @@ Read the \`omnidim://guide/workflows\` resource first. It explains triggers, out
|
|
|
650
675
|
const purpose = a.purpose || "(describe the agent's job)";
|
|
651
676
|
const voiceLine = a.voice_id
|
|
652
677
|
? `Use voice_id "${a.voice_id}" (the \`name\` from listVoices).`
|
|
653
|
-
: `
|
|
678
|
+
: `Start with the OmniDimension voices, our most recommended: call \`listVoices\` with \`provider=featured\` and pick the first one that speaks the caller's language. Use its \`name\` as voice_id and its \`service\` (\`cartesia\`) as the voice provider. Verify audio on the test call.`;
|
|
654
679
|
const testLine = a.test_number
|
|
655
680
|
? `5. Place a verification call with \`dispatchCall\` { requestBody: { agent_id, to_number: "${a.test_number}" } } (omit from_number_id to use the default outbound number). Capture the returned requestId.
|
|
656
681
|
6. Poll \`listCallLogs\` { pagesize: 1 } until a new row appears for ${a.test_number}, then \`getCallLog\` on its id. The call is verified ONLY if \`call_conversation\` is non-empty (the agent actually spoke). A successful dispatch response alone is not proof.`
|
|
@@ -670,8 +695,8 @@ Follow these steps in order. Each write tool wraps its payload in \`requestBody\
|
|
|
670
695
|
"context_breakdown": [ { "title": "Purpose", "body": "<the agent's instructions, derived from the purpose above>" } ],
|
|
671
696
|
"call_type": "Outgoing",
|
|
672
697
|
"model": { "model": "gpt-4.1-mini", "temperature": 0.5 },
|
|
673
|
-
"voice": { "provider": "
|
|
674
|
-
"transcriber": { "provider": "
|
|
698
|
+
"voice": { "provider": "cartesia", "voice_id": "<name from listVoices provider=featured>" },
|
|
699
|
+
"transcriber": { "provider": "soniox" }
|
|
675
700
|
}
|
|
676
701
|
}
|
|
677
702
|
Capture the returned \`id\` as agent_id. (\`status\` is always "Completed"; it is not a build signal.)
|
package/build/procedures.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"procedures.js","sourceRoot":"","sources":["../src/procedures.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,GAC5B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAWpG;;;;GAIG;AACH,MAAM,aAAa,GAAG
|
|
1
|
+
{"version":3,"file":"procedures.js","sourceRoot":"","sources":["../src/procedures.ts"],"names":[],"mappings":"AAQA,OAAO,EACH,sBAAsB,EACtB,wBAAwB,EACxB,0BAA0B,EAC1B,yBAAyB,GAC5B,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAWpG;;;;GAIG;AACH,MAA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 -62,7 +62,18 @@ function baseFields() {
|
|
|
62
62
|
os_arch: process.arch,
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
// Fire-and-forget sends tracked so the setup command can wait for them before process.exit.
|
|
66
|
+
const pending = new Set();
|
|
67
|
+
export async function flushTelemetry() {
|
|
68
|
+
await Promise.allSettled([...pending]);
|
|
69
|
+
}
|
|
70
|
+
function send(event, extra = {}) {
|
|
71
|
+
const p = doSend(event, extra);
|
|
72
|
+
pending.add(p);
|
|
73
|
+
void p.finally(() => pending.delete(p));
|
|
74
|
+
return p;
|
|
75
|
+
}
|
|
76
|
+
async function doSend(event, extra) {
|
|
66
77
|
if (isTelemetryDisabled())
|
|
67
78
|
return;
|
|
68
79
|
const body = {
|
package/build/telemetry.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"telemetry.js","sourceRoot":"","sources":["../src/telemetry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7E,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AACjE,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC,MAAM,QAAQ,GAAG,4CAA4C,CAAC;AAC9D,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AACzD,MAAM,eAAe,GAAG,IAAI,CAAC,UAAU,EAAE,YAAY,CAAC,CAAC;AACvD,MAAM,CAAC,MAAM,oBAAoB,GAAG,IAAI,CAAC,UAAU,EAAE,oBAAoB,CAAC,CAAC;AAC3E,MAA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,CAAC,CAAC,SAAS,CAAC;IAC7C,SAAS,CAAC;QACN,IAAI,EAAE,OAAO;QACb,KAAK;QACL,GAAG,aAAa,CAAC,KAAK,CAAC;QACvB,OAAO,EAAE,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC;KAClE,CAAC,CAAC;IACH,MAAM,IAAI,CAAC,eAAe,EAAE,EAAE,KAAK,EAAE,GAAG,aAAa,CAAC,KAAK,CAAC,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;AAChF,CAAC"}
|
|
@@ -8,3 +8,8 @@ export declare function toolAnnotations(def: {
|
|
|
8
8
|
name: string;
|
|
9
9
|
method: string;
|
|
10
10
|
}): ToolAnnotations;
|
|
11
|
+
export declare function readOnlyMode(env?: Record<string, string | undefined>): boolean;
|
|
12
|
+
export declare function keepReadOnlyTools(map: Map<string, {
|
|
13
|
+
name: string;
|
|
14
|
+
method: string;
|
|
15
|
+
}>): void;
|
|
@@ -6,9 +6,21 @@ import { TOOL_MARKS } from "./tool-marks.js";
|
|
|
6
6
|
// Tools that are not spec operations, so they carry no x-mcp block.
|
|
7
7
|
const HAND_MARKS = {
|
|
8
8
|
showWorkflow: { title: "Show workflow canvas", readOnlyHint: true, openWorldHint: false },
|
|
9
|
+
searchDocs: { title: "Search the docs", readOnlyHint: true, openWorldHint: false },
|
|
10
|
+
readDoc: { title: "Read a docs page", readOnlyHint: true, openWorldHint: false },
|
|
9
11
|
};
|
|
10
12
|
// Spec tools get their marks from the spec's x-mcp block, through regen.
|
|
11
13
|
export function toolAnnotations(def) {
|
|
12
14
|
return { ...(TOOL_MARKS[def.name] ?? HAND_MARKS[def.name] ?? {}) };
|
|
13
15
|
}
|
|
16
|
+
// OMNIDIM_READONLY=1 serves only tools that read data, so an agent cannot change the account or place a call.
|
|
17
|
+
export function readOnlyMode(env = process.env) {
|
|
18
|
+
return ["1", "true", "on", "yes"].includes((env.OMNIDIM_READONLY ?? "").toLowerCase());
|
|
19
|
+
}
|
|
20
|
+
export function keepReadOnlyTools(map) {
|
|
21
|
+
for (const def of [...map.values()]) {
|
|
22
|
+
if (!toolAnnotations(def).readOnlyHint)
|
|
23
|
+
map.delete(def.name);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
14
26
|
//# sourceMappingURL=tool-annotations.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tool-annotations.js","sourceRoot":"","sources":["../src/tool-annotations.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,wCAAwC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAS7C,oEAAoE;AACpE,MAAM,UAAU,GAAoC;IAClD,YAAY,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"tool-annotations.js","sourceRoot":"","sources":["../src/tool-annotations.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,wEAAwE;AACxE,0EAA0E;AAC1E,wCAAwC;AACxC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAS7C,oEAAoE;AACpE,MAAM,UAAU,GAAoC;IAClD,YAAY,EAAE,EAAE,KAAK,EAAE,sBAAsB,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IACzF,UAAU,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;IAClF,OAAO,EAAE,EAAE,KAAK,EAAE,kBAAkB,EAAE,YAAY,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE;CACjF,CAAC;AAEF,yEAAyE;AACzE,MAAM,UAAU,eAAe,CAAC,GAAqC;IACnE,OAAO,EAAE,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,UAAU,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,EAAE,CAAC;AACrE,CAAC;AAED,8GAA8G;AAC9G,MAAM,UAAU,YAAY,CAAC,MAA0C,OAAO,CAAC,GAAG;IAChF,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC,CAAC;AACzF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,GAAkD;IAClF,KAAK,MAAM,GAAG,IAAI,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,EAAE,CAAC;QACpC,IAAI,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC,YAAY;YAAE,GAAG,CAAC,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;IAC/D,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnidim-ai/mcp-server",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.20.0",
|
|
4
4
|
"mcpName": "io.github.Omnidim/omnidim-mcp-server",
|
|
5
5
|
"description": "Official MCP server for OmniDimension. Drive voice agents, dispatch calls, and manage knowledge bases from Claude, Cursor, Windsurf, and any MCP client.",
|
|
6
6
|
"type": "module",
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"start": "node build/index.js",
|
|
19
19
|
"build": "tsc && shx chmod 755 build/index.js",
|
|
20
20
|
"typecheck": "tsc --noEmit",
|
|
21
|
+
"pretest": "npm run build",
|
|
21
22
|
"test": "vitest run",
|
|
22
23
|
"test:canvas": "npm run build && node tests/canvas-browser/run.mjs",
|
|
23
24
|
"test:watch": "vitest",
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
// searchDocs and readDoc: answers from the public docs at docs.omnidim.io, no account data.
|
|
2
|
+
// Same tools as the hosted server's app/services/docs.py.
|
|
3
|
+
import { USER_AGENT } from "./helpers.js";
|
|
4
|
+
|
|
5
|
+
const DOCS_ORIGIN = "https://docs.omnidim.io";
|
|
6
|
+
const MAX_DOC_CHARS = 25_000;
|
|
7
|
+
// One segment per path part: letters, digits, dash, underscore, dot (never a bare "." or "..").
|
|
8
|
+
const DOC_PATH_RE = /^\/docs(\/(?!\.{1,2}(\/|$))[A-Za-z0-9._-]+)*\/?$/;
|
|
9
|
+
|
|
10
|
+
const DOCS_TOOLS = [
|
|
11
|
+
{
|
|
12
|
+
name: "searchDocs",
|
|
13
|
+
description:
|
|
14
|
+
"Search the OmniDimension documentation (guides and API reference) at docs.omnidim.io. " +
|
|
15
|
+
"Use it before guessing how a feature, field or error works. Returns up to 8 pages, best first, " +
|
|
16
|
+
"each with title, description and url. Read a page with `readDoc`.\n\n(Tags: Docs)",
|
|
17
|
+
inputSchema: {
|
|
18
|
+
type: "object",
|
|
19
|
+
properties: { query: { type: "string", description: "What to look for, in a few words." } },
|
|
20
|
+
required: ["query"],
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
name: "readDoc",
|
|
25
|
+
description:
|
|
26
|
+
"Read one docs.omnidim.io page as Markdown. Pass a `url` from `searchDocs`, or a path that " +
|
|
27
|
+
"starts with /docs/.\n\n(Tags: Docs)",
|
|
28
|
+
inputSchema: {
|
|
29
|
+
type: "object",
|
|
30
|
+
properties: {
|
|
31
|
+
url: {
|
|
32
|
+
type: "string",
|
|
33
|
+
description: "A docs.omnidim.io page url or path, e.g. /docs/get-started/quickstart.",
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
required: ["url"],
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
const NAMES = new Set(DOCS_TOOLS.map((t) => t.name));
|
|
42
|
+
|
|
43
|
+
export function isDocsTool(name: string): boolean {
|
|
44
|
+
return NAMES.has(name);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function addDocsTools(map: Map<string, any>): void {
|
|
48
|
+
for (const t of DOCS_TOOLS) {
|
|
49
|
+
map.set(t.name, { ...t, method: "get", pathTemplate: "", executionParameters: [], securityRequirements: [] });
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
// The /docs/ path of a docs.omnidim.io page url or path, or null for anything else.
|
|
54
|
+
export function docPath(raw: unknown): string | null {
|
|
55
|
+
if (typeof raw !== "string") return null;
|
|
56
|
+
const trimmed = raw.trim();
|
|
57
|
+
// A full url must be exactly this origin; anything left must then be a /docs/ path.
|
|
58
|
+
const full = /^https:\/\/docs\.omnidim\.io(\/.*)?$/s.exec(trimmed);
|
|
59
|
+
const rest = full ? (full[1] ?? "") : trimmed;
|
|
60
|
+
let path: string;
|
|
61
|
+
try {
|
|
62
|
+
path = decodeURIComponent(rest.split(/[?#]/)[0]);
|
|
63
|
+
} catch {
|
|
64
|
+
return null;
|
|
65
|
+
}
|
|
66
|
+
// The docs site redirects a trailing slash; asking for the final url saves a round trip.
|
|
67
|
+
return DOC_PATH_RE.test(path) ? path.replace(/\/+$/, "") || "/docs" : null;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
type Result = { content: Array<{ type: "text"; text: string }>; isError?: boolean };
|
|
71
|
+
|
|
72
|
+
const ok = (text: string): Result => ({ content: [{ type: "text", text }] });
|
|
73
|
+
const fail = (text: string): Result => ({ content: [{ type: "text", text: JSON.stringify({ error: text }) }], isError: true });
|
|
74
|
+
|
|
75
|
+
function upstreamError(status: number): Result {
|
|
76
|
+
return fail(status === 429 ? "The docs search is busy. Wait a minute, then try again." : `docs.omnidim.io answered ${status}. Try again later.`);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
async function get(fetchImpl: typeof fetch, url: string, headers: Record<string, string> = {}): Promise<Response> {
|
|
80
|
+
// The user's API key never goes to the docs site: these requests carry no Authorization.
|
|
81
|
+
return fetchImpl(url, { headers: { "User-Agent": USER_AGENT, ...headers }, signal: AbortSignal.timeout(15_000) });
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export async function callDocsTool(name: string, args: Record<string, unknown>, fetchImpl: typeof fetch = fetch): Promise<Result> {
|
|
85
|
+
try {
|
|
86
|
+
if (name === "searchDocs") {
|
|
87
|
+
const query = typeof args.query === "string" ? args.query.trim().slice(0, 200) : "";
|
|
88
|
+
if (!query) return fail("searchDocs needs a query.");
|
|
89
|
+
// /api/spotlight ranks pages the way the docs site's own search and chat do.
|
|
90
|
+
const res = await get(fetchImpl, `${DOCS_ORIGIN}/api/spotlight?${new URLSearchParams({ q: query })}`);
|
|
91
|
+
if (res.status !== 200) return upstreamError(res.status);
|
|
92
|
+
const hits = (await res.json()) as Array<{ url?: unknown; title?: unknown; description?: unknown }>;
|
|
93
|
+
const pages = hits
|
|
94
|
+
.filter((h) => typeof h?.url === "string" && h.url.startsWith("/"))
|
|
95
|
+
.map((h) => ({ title: h.title, description: h.description, url: DOCS_ORIGIN + h.url }));
|
|
96
|
+
return ok(JSON.stringify({ pages }, null, 2));
|
|
97
|
+
}
|
|
98
|
+
const path = docPath(args.url);
|
|
99
|
+
if (!path) return fail("readDoc reads only https://docs.omnidim.io pages under /docs/.");
|
|
100
|
+
const res = await get(fetchImpl, DOCS_ORIGIN + path, { Accept: "text/markdown" });
|
|
101
|
+
if (res.status === 404) return fail(`No docs page at ${path}.`);
|
|
102
|
+
if (res.status !== 200) return upstreamError(res.status);
|
|
103
|
+
let text = await res.text();
|
|
104
|
+
if (text.length > MAX_DOC_CHARS) text = `${text.slice(0, MAX_DOC_CHARS)}\n\n[Page cut at ${MAX_DOC_CHARS} of ${text.length} chars.]`;
|
|
105
|
+
return ok(text);
|
|
106
|
+
} catch (e) {
|
|
107
|
+
return fail(`docs.omnidim.io could not be reached (${e instanceof Error ? e.name : "error"}). Try again later.`);
|
|
108
|
+
}
|
|
109
|
+
}
|
package/src/helpers.ts
CHANGED
|
@@ -144,15 +144,46 @@ export function findList(data: unknown): { arr: unknown[]; key: string | null }
|
|
|
144
144
|
return null;
|
|
145
145
|
}
|
|
146
146
|
|
|
147
|
-
//
|
|
148
|
-
|
|
147
|
+
// Call logs without their per-turn `interactions`, which are most of a call log's size.
|
|
148
|
+
function withoutTurnDetail(data: unknown): unknown | null {
|
|
149
|
+
const list = findList(data);
|
|
150
|
+
const rows = list ? list.arr : [data];
|
|
151
|
+
if (!rows.some((r) => r && typeof r === "object" && "interactions" in r)) return null;
|
|
152
|
+
const slim = rows.map((r) => {
|
|
153
|
+
if (!r || typeof r !== "object") return r;
|
|
154
|
+
const { interactions: _dropped, ...rest } = r as Record<string, unknown>;
|
|
155
|
+
return rest;
|
|
156
|
+
});
|
|
157
|
+
if (!list) return slim[0];
|
|
158
|
+
return list.key ? { ...(data as Record<string, unknown>), [list.key]: slim } : slim;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
// Trim responses to fit a model context budget: call log turn detail first, then
|
|
162
|
+
// list rows. Other single resources are never trimmed; an oversized getAgent etc.
|
|
149
163
|
// is handled by the MCP client (spill-to-file + chunked read).
|
|
164
|
+
|
|
150
165
|
export function trimLargeResponse(data: unknown): { text: string; note?: string } {
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
166
|
+
let redacted = redactSensitive(data);
|
|
167
|
+
let full = JSON.stringify(redacted, null, 2);
|
|
168
|
+
if (full.length <= MAX_LIST_CHARS) return { text: full };
|
|
169
|
+
|
|
170
|
+
// Turn detail goes before rows or a cut, so transcript, recording and cost always arrive.
|
|
171
|
+
const slim = withoutTurnDetail(redacted);
|
|
172
|
+
const dropNote = slim !== null ? " Left out per-turn detail (interactions)." : "";
|
|
173
|
+
if (slim !== null) {
|
|
174
|
+
const slimText = JSON.stringify(slim, null, 2);
|
|
175
|
+
if (slimText.length <= MAX_LIST_CHARS) {
|
|
176
|
+
return {
|
|
177
|
+
text: slimText,
|
|
178
|
+
note: "[Left out per-turn detail (interactions) to fit. call_conversation has the transcript.]",
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
redacted = slim;
|
|
182
|
+
full = slimText;
|
|
183
|
+
}
|
|
154
184
|
|
|
155
|
-
|
|
185
|
+
const list = findList(redacted);
|
|
186
|
+
if (!list) return { text: full };
|
|
156
187
|
|
|
157
188
|
const { arr, key } = list;
|
|
158
189
|
let kept = arr.length;
|
|
@@ -164,7 +195,7 @@ export function trimLargeResponse(data: unknown): { text: string; note?: string
|
|
|
164
195
|
if (candidate.length <= MAX_LIST_CHARS) {
|
|
165
196
|
return {
|
|
166
197
|
text: candidate,
|
|
167
|
-
note: `[Showing ${kept} of ${arr.length} items
|
|
198
|
+
note: `[Showing ${kept} of ${arr.length} items.${dropNote} Lower pagesize, filter by name, or fetch a specific item by ID for full detail.]`,
|
|
168
199
|
};
|
|
169
200
|
}
|
|
170
201
|
kept = Math.max(1, Math.floor(kept * 0.6));
|
|
@@ -172,7 +203,7 @@ export function trimLargeResponse(data: unknown): { text: string; note?: string
|
|
|
172
203
|
|
|
173
204
|
return {
|
|
174
205
|
text: full.slice(0, MAX_LIST_CHARS),
|
|
175
|
-
note: `[Response truncated. Full size: ${full.length} chars
|
|
206
|
+
note: `[Response truncated. Full size: ${full.length} chars.${dropNote}]`,
|
|
176
207
|
};
|
|
177
208
|
}
|
|
178
209
|
|