@casys/mcp-erpnext 3.2.2 → 3.2.3
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 +2 -2
- package/mcp-erpnext.mjs +14 -4
- package/package.json +1 -1
- package/ui-dist/buy-evidence-viewer/index.html +2 -2
- package/ui-dist/chart-viewer/index.html +48 -48
- package/ui-dist/doc-viewer/index.html +28 -28
- package/ui-dist/doclist-viewer/index.html +29 -29
- package/ui-dist/funnel-viewer/index.html +28 -28
- package/ui-dist/invoice-viewer/index.html +28 -28
- package/ui-dist/kanban-viewer/index.html +12 -12
- package/ui-dist/kpi-viewer/index.html +28 -28
- package/ui-dist/stock-viewer/index.html +27 -27
package/README.md
CHANGED
|
@@ -11,7 +11,7 @@ English | [繁體中文](README.zh-TW.md)
|
|
|
11
11
|
|
|
12
12
|
> [!IMPORTANT]
|
|
13
13
|
> **Installing 3.2:** for npm/Node use `npx -y @casys/mcp-erpnext@latest`; for
|
|
14
|
-
> Deno use `deno run -A jsr:@casys/mcp-erpnext@3.2.
|
|
14
|
+
> Deno use `deno run -A jsr:@casys/mcp-erpnext@3.2.3/server`. 3.2.3 is the
|
|
15
15
|
> stable release and carries npm's `latest` tag; prereleases, when published,
|
|
16
16
|
> use the `next` tag. 3.2 adds the generic document viewer and attachment
|
|
17
17
|
> workflows, so test it with the MCP host your users actually run before
|
|
@@ -96,7 +96,7 @@ stable 3.0.5 and 3.1.0 releases. Features remain capability-gated by the MCP
|
|
|
96
96
|
host; Buy evidence does not purchase or qualify a live ERP.
|
|
97
97
|
|
|
98
98
|
For stable npm installations use `@casys/mcp-erpnext@latest`; for Deno use
|
|
99
|
-
`jsr:@casys/mcp-erpnext@3.2.
|
|
99
|
+
`jsr:@casys/mcp-erpnext@3.2.3/server`.
|
|
100
100
|
|
|
101
101
|
See the [CHANGELOG](CHANGELOG.md) for the full release history, or the
|
|
102
102
|
[latest release](https://github.com/Casys-AI/mcp-erpnext/releases/latest) for
|
package/mcp-erpnext.mjs
CHANGED
|
@@ -42720,6 +42720,7 @@ var FrappeClient = class {
|
|
|
42720
42720
|
async requestOnce(method, path, body, multipart = false, signal) {
|
|
42721
42721
|
const controller = new AbortController();
|
|
42722
42722
|
const detach = relayAbort(signal, controller);
|
|
42723
|
+
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
42723
42724
|
try {
|
|
42724
42725
|
return await this.sendOnce(
|
|
42725
42726
|
method,
|
|
@@ -42730,12 +42731,12 @@ var FrappeClient = class {
|
|
|
42730
42731
|
signal
|
|
42731
42732
|
);
|
|
42732
42733
|
} finally {
|
|
42734
|
+
clearTimeout(timer);
|
|
42733
42735
|
detach();
|
|
42734
42736
|
}
|
|
42735
42737
|
}
|
|
42736
42738
|
async sendOnce(method, path, body, multipart, controller, callerSignal) {
|
|
42737
42739
|
const url2 = `${this.baseUrl}${path}`;
|
|
42738
|
-
const timer = setTimeout(() => controller.abort(), this.timeoutMs);
|
|
42739
42740
|
let response;
|
|
42740
42741
|
try {
|
|
42741
42742
|
response = await fetch(url2, {
|
|
@@ -42745,7 +42746,6 @@ var FrappeClient = class {
|
|
|
42745
42746
|
signal: controller.signal
|
|
42746
42747
|
});
|
|
42747
42748
|
} catch (err) {
|
|
42748
|
-
clearTimeout(timer);
|
|
42749
42749
|
if (err instanceof Error && err.name === "AbortError") {
|
|
42750
42750
|
if (callerSignal?.aborted) throw callerAbortError(method, path);
|
|
42751
42751
|
throw new FrappeAPIError(
|
|
@@ -42760,12 +42760,18 @@ var FrappeClient = class {
|
|
|
42760
42760
|
null
|
|
42761
42761
|
);
|
|
42762
42762
|
}
|
|
42763
|
-
clearTimeout(timer);
|
|
42764
42763
|
let rawText;
|
|
42765
42764
|
try {
|
|
42766
42765
|
rawText = await response.text();
|
|
42767
42766
|
} catch (err) {
|
|
42768
42767
|
if (callerSignal?.aborted) throw callerAbortError(method, path);
|
|
42768
|
+
if (err instanceof Error && err.name === "AbortError") {
|
|
42769
|
+
throw new FrappeAPIError(
|
|
42770
|
+
`Request timed out after ${this.timeoutMs}ms: ${method} ${path}`,
|
|
42771
|
+
408,
|
|
42772
|
+
null
|
|
42773
|
+
);
|
|
42774
|
+
}
|
|
42769
42775
|
throw err;
|
|
42770
42776
|
}
|
|
42771
42777
|
const contentType = response.headers.get("content-type") ?? "";
|
|
@@ -56140,6 +56146,9 @@ function loadMrtrConfig() {
|
|
|
56140
56146
|
return { signingKey };
|
|
56141
56147
|
}
|
|
56142
56148
|
|
|
56149
|
+
// src/server-instructions.ts
|
|
56150
|
+
var ACTIVE_CONTEXT_INSTRUCTIONS = 'User selections in ERPNext viewers are shared as model context on compatible hosts with schema "casys.erpnext/active-context", version 2, and an items array of {id, view, label, value?}. This context identifies the documents and values the user is referring to. Document selections have IDs of the form record:<doctype>:<name>. Their <name> component is accepted as the name argument by the matching *_get tool; erpnext_doc_get accepts <doctype> and <name> as separate arguments. Child-row selections add :row:<table>:<row> to the document ID.';
|
|
56151
|
+
|
|
56143
56152
|
// server.ts
|
|
56144
56153
|
var DEFAULT_HTTP_PORT = 3012;
|
|
56145
56154
|
function registerBuyViewAppManifest(server) {
|
|
@@ -56201,7 +56210,8 @@ async function main() {
|
|
|
56201
56210
|
assertNonEmptySelection(toolsClient.selection);
|
|
56202
56211
|
const server = new McpApp({
|
|
56203
56212
|
name: "mcp-erpnext",
|
|
56204
|
-
version: "3.2.
|
|
56213
|
+
version: "3.2.3",
|
|
56214
|
+
instructions: ACTIVE_CONTEXT_INSTRUCTIONS,
|
|
56205
56215
|
transport: "stateless",
|
|
56206
56216
|
cache: {
|
|
56207
56217
|
ttlMs: 36e5,
|